douguanya4248 2010-06-17 23:32
浏览 101
已采纳

将换行符从XML插入数据库

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: Character

The first problem I had was using the like below.

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

The problem was in the database the field came out ot be jquery_ui.js shadowbox_modal.js ... 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?

  • 写回答

1条回答 默认 最新

  • donjd86266 2010-06-18 09:17
    关注

    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.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 公交车和无人机协同运输
  • ¥15 stm32代码移植没反应
  • ¥15 matlab基于pde算法图像修复,为什么只能对示例图像有效
  • ¥100 连续两帧图像高速减法
  • ¥15 组策略中的计算机配置策略无法下发
  • ¥15 如何绘制动力学系统的相图
  • ¥15 对接wps接口实现获取元数据
  • ¥20 给自己本科IT专业毕业的妹m找个实习工作
  • ¥15 用友U8:向一个无法连接的网络尝试了一个套接字操作,如何解决?
  • ¥30 我的代码按理说完成了模型的搭建、训练、验证测试等工作(标签-网络|关键词-变化检测)