XSl Element
|
Das xsl: Element erzeugt die Elemente innen zur Zeit der Verarbeitung.
|
XML source
<?xml version="1.0"?>
<xslTutorial >
<text size="H1">Header1</text>
<text size="H3">Header3</text>
<text size="b">Bold text</text>
<text size="sub">Subscript</text>
<text size="sup">Superscript</text>
</xslTutorial>
|
HTML output 1
<HTML>
<HEAD> </HEAD>
<BODY>
<H1>Header1</H1>
<H3>Header3</H3>
<b>Bold text</b>
<sub>Subscript</sub>
<sup>Superscript</sup>
</BODY>
</HTML>
|
|
XSL stylesheet 1
<xsl:stylesheet xmlns:xsl='http://www.w3.org/1999/XSL/Transform' >
<xsl:template match="/">
<xsl:for-each select="//text">
<xsl:element name="{@size}"><xsl:value-of select="."/></xsl:element>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
|
|
Das XSL Attribut
|
Das xsl: Attribut erzeugt die Elemente in der Zeit der Verarbeitung. Es verursacht das Attribut im Element, in dem es umgeben wird.
|
XML source
<?xml version="1.0"?>
<xslTutorial >
<color>blue</color>
<color>navy</color>
<color>green</color>
<color>lime</color>
<color>red</color>
|
HTML output 1
<HTML>
<HEAD> </HEAD>
<BODY>
<TABLE>
<TR>
<TD style="
color:blue">blue</TD></TR></TABLE>
<TABLE>
<TR>
<TD style="
color:navy">navy</TD></TR></TABLE>
<TABLE>
<TR>
<TD style="
color:green">green</TD></TR></TABLE>
<TABLE>
<TR>
<TD style="
color:lime">lime</TD></TR></TABLE>
<TABLE>
<TR>
<TD style="
color:red">red</TD></TR>
</TABLE>
</BODY>
</HTML>
|
|
XSL stylesheet 1
<xsl:stylesheet xmlns:xsl='http://www.w3.org/1999/XSL/Transform' >
<xsl:template match="color">
<TABLE>
<TR><TD>
<xsl:attribute name="style">
color:<xsl:value-of select="."/>
</xsl:attribute>
<xsl:value-of select="."/>
</TD></TR>
</TABLE>
</xsl:template>
</xsl:stylesheet>
|
|
The Copy and Copy-of Constructs
|
Das copy und Kopie-vom Konstruieren werden f�r die Nullpunktkopie benutzt. Das copy Element kopiert hinunter nur den gegenw�rtigen Nullpunkt ohne die Kinder und die Attribute, w�hrend Kopie-von Kopien tun alles.
|
XML source
<?xml version="1.0"?>
<xslTutorial >
<p id="a12">
Compare <B>these constructs</B>
</p>
</xslTutorial>
|
HTML output 1
<HTML>
<HEAD> </HEAD>
<BODY>
<DIV>
<B>copy-of : </B>
<p id="a12"> Compare
<B>these constructs</B>. </p></DIV>
<DIV>
<B>copy : </B>
<p/></DIV>
<DIV>
<B>value-of : </B> Compare these constructs.
</DIV>
</BODY>
</HTML>
|
|
XSL stylesheet 1
<xsl:stylesheet xmlns:xsl='http://www.w3.org/1999/XSL/Transform' >
<xsl:template match="p">
<DIV><B><xsl:text> copy-of : </xsl:text> </B> ;
<xsl:copy-of select="."/>
</DIV>
<DIV><B><xsl:text> copy : </xsl:text> </B>
<xsl:copy/ >
</DIV>
<DIV><B><xsl:text> value-of : </xsl:text> </B>
<xsl:value-of select="."/>
</DIV>
</xsl:template>
</xsl:stylesheet>
|
|
|
|
Keywords XSL Elements, xsl element, xslt element, the stylesheet does not contain a document element,
xsd element, stylesheet does not contain a document element, cdata section elements,
xpath element, xsd elements, cdata element, xslt elements, xsl element name, xsd optional element,
xsl for each, stylesheet element, xsl value of, asp net xsl, xsl select element, xml elements,
element in xslt
|