How do I preserve markup tags?

后端 未结 5 1523
太阳男子
太阳男子 2021-02-18 23:52

I\'ve got an XML document containing news stories, and the body element of a news story contains p tags amongst the plain text. When I use XSL to retrieve the body, e.g.

5条回答
  •  暗喜
    暗喜 (楼主)
    2021-02-19 00:04

    The value of an XML element - this is true not just in XSLT but in DOM implementations - is the concatenation of all of its descendant text nodes. In XSLT, value-of emits an element's value, while copy-of emits a copy of the element.

提交回复
热议问题