Recently, I wrote about the combination of XML + XSL and HTML. Article Someone asked me how to display the content in CDATA in HTML format (especially the HTML written by users is not standard ). I wanted to write an example, and then I went to Google to check it and found someone already wrote it. In: http://java.blogger.cn/wuyu/posts/1460.aspx
Note: XSL disable-output-escaping = "yes"
Its core is to use disable-output-escaping = "yes"
The description on msdn is as follows:
disable-output-escaping
default is "no ". if the value is "yes", a text node generated by instantiating the element will be output without any escaping. for example, the following generates the single character "<".
note ?? Disable-output-escaping = "yes" can be used to generate non-well-formed statements, and thus shocould be used with caution, because non-well-formed output may generate errors in certain circumstances. for example, transformnodetoobject to an XML document requires that the result be well-formed and thus may not complete ifdisable-output-escaping has affected the well-formedness of the document. consider disable-output-escaping = "yes" an advanced feature to be used only when the potential dangers are understood.