XSLT preliminary test

Source: Internet
Author: User
Tags xsl xsl file xslt

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

 

Related Article

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.