开发者

Escape <?xml version="1.0" ?> tag from HTML

I am trying to embedded a XML inside开发者_JAVA技巧 a HTML page with hidden div and using it latter to populate UI fields.

The problem is, I can't parse it since tag is missing.

How can I escape the entire tag?


Why not add that tag and then parse it?


I would be better to put the content inside a hidden textarea, to keep your HTML markup correct.

Either way, you should be able to escape it by changing < to &lt; and > to &gt;.

(This should be done to the all of the XML tags, not only the <?xml ?> tag.)

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜