开发者

Inserting Newline from XML to Database

I am trying to parse this xml document in which a newline is required for certain fields and must be inserted into the database with the newline. But I've been running into problems.

1)First Problem: \n Character

The first problem I had was using the \n like below.

<javascript>jquery_ui.js\nshadowbox_modal.js\nuser_p开发者_StackOverflow社区rofile.js\ntablesorter.js</javascript>

The problem was in the database the field came out ot be jquery_ui.js\nshadowbox_modal.js\n... and when output into html it was jquery_ui.jsnshadowbox_modal.jsn...............

2) Then I tried actually having newlines in the xml

<javascript>jquery_ui.js
           shadowbox_modal.js
           user_profile.js
           tablesorter.js</javascript>

The problem was the output become %20%20%20%20%20%20%20%20%20%20shadowbox_modal.js, and so forth. So how can I get a newline to hold from xml when entered into a database and then output with the newline still?


Remove the spaces from your second example.

You probably entered a tab and/or spaces for readability, but these get inserted too.

%20 is an urlencoded space.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜