XSL outputs the CDATA comment in XML as an example of HTML text code

Source: Internet
Author: User
Output the CDATA comment in the XML document as HTML text using XSL To use DOM to access XML files, you must link the XML file to an HTML webpage.

Sample code

1. test. xml

 
 
 
  entry with images
  
   August 09, 2003
  Kevin
  
   000033
  
  
   http://alazanto.org/xml/archives/000033.xml</permalink>
   
    http://alazanto.org/xml/archives/000033_comments.xml</comment-link>
    
     6
    
   
  
 

2. test. xsl

 
 
  
   
   
  
 


The key is to add disable-output-escaping = "yes" to the namespace xmlns: xsl = "www.w3.org/5o/#/transform" and output"

Sample code

1. test. xml

 
 
 
  entry with images
  
   August 09, 2003
  Kevin
  
   000033
  
  
   http://alazanto.org/xml/archives/000033.xml</permalink>
   
    http://alazanto.org/xml/archives/000033_comments.xml</comment-link>
    
     6
    
   
  
 

2. test. xsl

 
 
  
   
   
  
 

The key is to use the namespace xmlns: xsl = "http://www.w3.org/1999/XSL/Transform" and add disable-output-escaping = "yes" to the output"

The above is the detailed content of the code instance that XSL outputs the CDATA annotation in XML into HTML text. For more information, see other related articles in the first PHP community!

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.