Expose content in CDATA (possibly irregular HTML code) in HTML. _ Experience Exchange

Source: Internet
Author: User
Tags cdata xsl
I wrote xml+xsl and HTML a few days ago, and then someone asked me how to show the CDATA content in HTML (especially when the user writes HTML that is not standard). Originally wanted to write an example, and then to Google on a check, found that someone has written. Right here: http://java.blogger.cn/wuyu/posts/1460.aspx


Note: XSL's disable-output-escaping= "yes"

The core is the use of disable-output-escaping= "yes"

It is described on MSDN as follows:

Disable-output-escaping
The Default is "no". If the value is ' yes ', a text node generated by instantiating the element would be output without any escaping. For example, the following generates is the single character "<".
<
Note?? Disable-output-escaping= "Yes" can be used to generate non-well-formed documents, and thus should is used with caution, BEC Ause non-well-formed output may generate errors in certain circumstances. For example, transformNodeToObject to a XML document requires that the result is well-formed and thus may not complete if Disable-output-escaping has affected the well-formedness of the document. Consider disable-output-escaping= "yes" a advanced feature to be used only when the potential dangers the are.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.