What is XSL
Full name extensible Style Language, Chinese translation extended style language, used to format XML documents, it consists of two parts.
1 (XSLT): XSL transformation Language (XSLT), which converts an XML document from one format to another. such as converting to HTML, text, or text-based documents.
2 (XPath): XSL Format object, formatting object provides another way of CSS
To format the XML document and apply the style to the XML document!
Use of XML
Data in HTML format as follows:
<HTML>
<BODY>
<table border=1 cellspacing=0>
<th>name<td>5do8<th>id<td>1
<TR>
<TH>PROFESSIONAL:<TD colspan=5>.net,php Design
</TABLE>
</BODY>
</HTML>
The HTML file cannot be ideographic if modified to: <?xml version= "1.0" encoding= "GB2312"?>
<About>
<Name>5do8</Name>
<ID>1</ID>
<professional>.net,php design</professional>
</About>
Can clearly indicate the meaning of the node. On the other hand, it's also more flexible for developers to get data from the data tier.
With regard to XML files, you need to note:
Header of XML file:
The 1:version stipulates the version of the XML document, which is 1.0;
2:encoding the encoding type of XML document, where the value is "GB2312", that is, "Simplified Chinese", be sure to save the file in ANSI format, if the file also has Chinese, the proposed format GB2312, or UFT-8, the file header and save the type should be unified.
With regard to the body of an XML file, you need to note:
1: Must have a root node.
2: Nodes must appear in pairs.
3: To use the escape character conversion <,>.
Two ways to output XML
In the performance of the XML foreground page, there are two ways, one is CSS, style sheet can be a simple output page, but can not change the pattern, can not judge, can not verify. It's very monotonous. This is not a table here.
Another, more flexible, is the use of XSL, which acts as a role in outputting the XML file in the specified mode, and the legitimate XSL format must be an XML file.
Schema language for XSL
The pattern language of XSL is divided into three types:
1: Select mode:
<xsl:for-each>,<xsl:value-of>,<xsl:apply-templates>
2: Matching mode
<xsl:template>
3: Test mode
<xsl:if> and <xsl:choose>
each of the following tutorials provides a detailed description of each model, please pay attention.
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.