Some elements in. Net xslt xml Conversion contain xmlns = ""

Source: Internet
Author: User
Tags xsl xslt

For example:<H1Xmlns = "">Dancing


According to W3C rules, if the namespace except xmlns: XSL is specified during XSLT conversion, when <XSL: element is used to generate a new node, the namespace is automatically added.

It is estimated that the "Other Namespaces" also include the xmlns of <HTML>, so that we can add a sentence on <XSL: stylesheet>.
Xmlns = "http://www.w3.org/1999/xhtml", and remove the xmlns on the <HTML>, there is no problem

Practice found that the above method will still lead to old problems. After some searches, we found the final solution on a foreigner's website.

First remove all xmlns = "http://www.w3.org/1999/xhtml", add an XSL: Test directly after the XSLT document <XSL: template match = "/">
The content is as follows:

 

 

<XSL: Text disable-output-escaping = "yes"> <! -- [CDATA [<! Doctype HTML public "-// W3C // dtd xhtml 1.1 // en" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> <HTML xmlns = "http://www.w3.org/1999/xhtml">]> </XSL: text> <br/> Add <br/> <XSL: Template> <br/> <XSL: Text disable-output-escaping = "yes"> <! [CDATA [</ptml>] --> </XSL: Text> 

 

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.