English | Français | Deutsch | >> Magyar << | 中文 | Polski | ZVON > Tutorials > XSLT Tutorial |
Bevezetés / Keresés / ZVON |
>> Oldal 35 << | Előző | Következő | Tartalom | Elem index |
XML forrás
<source> <TABLE border="1"> <TR> <TD>AAA</TD> <TD>BBB</TD> </TR> <TR> <TD>aaa</TD> <TD>bbb</TD> </TR> </TABLE> <TABLE border="1"> <TR> <TD>1111111</TD> </TR> <TR> <TD>22222222</TD> </TR> </TABLE> </source> Kimenet
<TABLE border="1"> <TR> <TD>1111111</TD> </TR> <TR> <TD>22222222</TD> </TR> </TABLE> <TABLE border="1"> <TR> <TD>AAA</TD> <TD>BBB</TD> </TR> <TR> <TD>aaa</TD> <TD>bbb</TD> </TR> </TABLE> <TABLE border="1"> <TR> <TD>1111111</TD> </TR> <TR> <TD>22222222</TD> </TR> </TABLE> HTML nézet
|
XSLT stíluslap
<xsl:stylesheet version = '1.0'
xmlns:xsl='http://www.w3.org/1999/XSL/Transform'> <xsl:variable name="A1"> <xsl:copy-of select="//TABLE[1]"/> </xsl:variable> <xsl:variable name="A2"> <xsl:copy-of select="//TABLE[2]"/> </xsl:variable> <xsl:template match="/"> <xsl:copy-of select="$A2"/> <xsl:copy-of select="$A1"/> <xsl:copy-of select="$A2"/> </xsl:template> </xsl:stylesheet> |
XML forrás
<source> <TABLE border="1"> <TR> <TD>AAA</TD> <TD>BBB</TD> </TR> <TR> <TD>aaa</TD> <TD>bbb</TD> </TR> </TABLE> <TABLE border="1"> <TR> <TD>1111111</TD> </TR> <TR> <TD>22222222</TD> </TR> </TABLE> </source> Kimenet
<P> 1111111 22222222 </P> <P> AAA BBB aaa bbb </P> <P> 1111111 22222222 </P> HTML nézet
1111111 22222222 AAA BBB aaa bbb 1111111 22222222 |
XSLT stíluslap
<xsl:stylesheet version = '1.0'
xmlns:xsl='http://www.w3.org/1999/XSL/Transform'> <xsl:variable name="A1"> <xsl:copy-of select="//TABLE[1]"/> </xsl:variable> <xsl:variable name="A2"> <xsl:copy-of select="//TABLE[2]"/> </xsl:variable> <xsl:template match="/"> <P> <xsl:value-of select="$A2"/> </P> <P> <xsl:value-of select="$A1"/> </P> <P> <xsl:value-of select="$A2"/> </P> </xsl:template> </xsl:stylesheet> |