Solutions and problems for standardization of XML + XLST output code in ASP. NET

Source: Internet
Author: User

In the past two days, we have been working on XML + XSLT output standardization, that is, the output of the XHTML StandardCode

The namespace xmlns ="Http://www.w3.org/1999/xhtml"Is the key to correctly outputting the XHTML Standard
If this namespace is not available, the output document tag will automatically remove the ending/The symbol <meta xxx/> is changed to <meta XXX>

There are two alternative methods:
1. Define an xhtmlwrite class and rewrite the writeendelement () method to disable the method;
2. Add the above space to the template file XLST ~ .

For the first method, the result is that all <XSL: Output Methods in the XSLT template are ineffective, and the output format looks different from that on w3.

The second method is to automatically merge the labels of empty content in the output result, that is, the result <div> </div> is changed to <DIV/>, which is quite uncomfortable. the current solution is to add<XSL: Text> </XSL: Text>Or add a tag at the end of the tag that you do not want to close.XML: Space = "preserve">And wrap the ending label.

I don't know what Microsoft is thinking.XsltransformChangeXslcompiledtransformThe result is such a thing ~

If any hero has a better solution, please remind me.

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.