Document directory
- Question 1: using the Java namespace definition example mentioned above, I wrote an XSL file. What is the resolution effect in IE browser? Why is this effect?
- <XSL: For-each>
- <XSL: If>
- <XSL: Choose>
XSL, Extensible Stylesheet Language, extensible style language.
You can say that he is a style. He said that he is a language because he supports expressions and execution logic;
You can say that he is a language. He can actually convert a Word file into a PDF file.
The following is a simple XSL file:
<? XML version = "1.0" encoding = "UTF-8"?>
<XSL: stylesheet xmlns: XSL = "http://www.w3.org/1999/XSL/Transform" version = "1.0">
<XSL: template match = "/">
<HTML>
</XSL: Template>
</XSL: stylesheet>
From the above XSL example, we can find that:
XSL is an XML file. The first line is a standard XML declaration;
W3C has an international standard for XSL. Generally, the alias of this namespace is XSL;
Correspondingly, there are some transform standards, such as the XML Parser supported by Microsoft: xmlns: msxsl = "urn: Schemas-Microsoft-com: XSLT"
In Java, all static methods can be used in XSL, for example, defining a namespace xmlns: Yizi = "java.net. urlencoder ", then we can write <XSL: value-of select =" Yizi: encode ('HTTP: // www.baidu.com ') "/>
Question 1: using the Java namespace definition example mentioned above, I wrote an XSL file. What is the resolution effect in IE browser? Why is this effect?
<? XML version = "1.0" encoding = "UTF-8"?>
<? XML-stylesheet type = "text/XSL" href = "sample. XSL"?>
<HTML xmlns: xsi = "http://www.w3.org/2001/XMLSchema-instance" xsi: nonamespaceschemalocation = "D:/gz_wap.xsd">
<Head>
<Title/>
</Head>
<Body>
<A href = "http://forum.csdn.net/BList/Enterprise" id = "A1"> Enterprise Development Forum </a>
</Body>
</Html>
<XSL: stylesheet xmlns: XSL = "http://www.w3.org/1999/XSL/Transform" version = "1.0" xmlns: Yizi = "java.net. urlencoder">
<XSL: output method = "html"/>
<XSL: template match = "/">
<HTML>
<Body>
Title = <XSL: value-of select = "// A/text ()"/> <br/>
Href = <XSL: value-of select = "// A/@ href"/> <br/>
Urlencode = <XSL: value-of select = "Yizi: encode (// A @ href)"/>
</Body>
</Html>
</XSL: Template>
</XSL: stylesheet>
The most common Node
Example XML:
<? XML version = "1.0" encoding = "UTF-8"?>
<? XML-stylesheet type = "text/XSL" href = "sample. XSL"?>
<HTML>
<Head>
<Title/>
</Head>
<Body>
<A href = "http://forum.csdn.net/BList/Enterprise" id = "A1"> Enterprise Development Forum </a>
<A href = "" id = "A2"> Empty connection </a>
<A href = "http://www.baidu.com" id = "A3"> Baidu </a>
</Body>
</Html>
<XSL: For-each>
<XSL: If>
If the href attribute of <A> is null, It is not displayed.
The display format is: Title = Corporate Development Forum, href = http://forum.csdn.net/BList/Enterprise
<XSL: Choose>
Display the href and text () of all <A> labels with the href attribute, display text () without the href attribute, and indicate that the href is empty
The display format is: Title = Corporate Development Forum, href = http://forum.csdn.net/BList/Enterprise
Title = Baidu, href = NULL