Read the XSLT tutorial and make an example at the following URL.
Http://www.w3school.com.cn/xsl/xsl_transformation.asp
1. Add CSS to the XML file
<?xml-stylesheet type="text/css" href="cd_catalog.css"?>
2. Add the XSLT file in XML
<? XML-stylesheet type = "text/XSL" href = "teststyle. XSLT"?>
Environment: The vs2010 framework is 3.5.
A new file named XSLT is created, instead of an XSL file. By default, it has the following sentence:
<XSL: output method = "XML" indent = "yes"/>
Because my XSLT file is output in HTML, if the method is XML, it will show incorrect, as shown in
<?xml version="1.0" encoding="utf-8"?><xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt" exclude-result-prefixes="msxsl"> <xsl:output method="html" indent="yes"/> <xsl:template match="/">
You only need to change the method property value to HTML, or remove this sentence, so that it can be displayed successfully!
Refer to the following URL
Http://geekswithblogs.net/Shuvo/archive/2009/02/17/how-to-refer-a-xslt-file-in-a-xml-dcoment.aspx