>> English << | Français | Deutsch | Magyar | 中文 | Polski enternetusers > Tutorials > XSLT Tutorial
>> Page 15 << | Prev | Next | Contents | Element Index

Axes play a very important role in XSLT. See XSLT reference for more details. Compare: child axis ( XSLT stylesheet 1 ), descendant axis ( XSLT stylesheet 2 ), parent axis ( XSLT stylesheet 3 ), ancestor axis ( XSLT stylesheet 4 ), following-sibling axis ( XSLT stylesheet 5 ), preceding-sibling axis ( XSLT stylesheet 6 ), following axis ( XSLT stylesheet 7 ), preceding axis ( XSLT stylesheet 8 ), attribute axis ( XSLT stylesheet 9 ), namespace axis ( XSLT stylesheet 10 ), self axis ( XSLT stylesheet 11 ), descendant-or-self axis ( XSLT stylesheet 12 ), ancestor-or-self axis ( XSLT stylesheet 13 ).

XSLT stylesheet 1

XML Source
<source>

<AAA id="a1" pos="start">
<BBB id="b1"/>
<BBB id="b2"/>
</AAA>
<AAA id="a2">
<BBB id="b3"/>
<BBB id="b4"/>
<CCC id="c1">
<CCC id="c2"/>
</CCC>
<BBB id="b5">
<CCC id="c3"/>
</BBB>
</AAA>

</source>

Output
<table border="1" cellpadding="6">
<tr>
<th colspan="2">Axis: child</th>
</tr>
<tr>
<th>Element</th>
<th>Node-set</th>
</tr>
<tr>
<td>AAA id = a1</td>
<td>b1b2</td>
</tr>
<tr>
<td>BBB id = b1</td>
<td/>
</tr>
<tr>
<td>BBB id = b2</td>
<td/>
</tr>
<tr>
<td>AAA id = a2</td>
<td>b3b4c1b5</td>
</tr>
<tr>
<td>BBB id = b3</td>
<td/>
</tr>
<tr>
<td>BBB id = b4</td>
<td/>
</tr>
<tr>
<td>CCC id = c1</td>
<td>c2</td>
</tr>
<tr>
<td>CCC id = c2</td>
<td/>
</tr>
<tr>
<td>BBB id = b5</td>
<td>c3</td>
</tr>
<tr>
<td>CCC id = c3</td>
<td/>
</tr>
</table>

HTML view
Axis: child
Element Node-set
AAA id = a1 b1b2
BBB id = b1
BBB id = b2
AAA id = a2 b3b4c1b5
BBB id = b3
BBB id = b4
CCC id = c1 c2
CCC id = c2
BBB id = b5 c3
CCC id = c3
XSLT stylesheet
<xsl:stylesheet version = '1.0'
xmlns:xsl='http://www.w3.org/1999/XSL/Transform'>

<xsl:template match="/">
<table border="1" cellpadding="6">
<tr>
<th colspan="2">Axis: child</th>
</tr>
<tr>
<th>Element</th>
<th>Node-set</th>
</tr>
<xsl:for-each select="/source//*">
<xsl:call-template name="print"/>
</xsl:for-each>
</table>
</xsl:template>

<xsl:template name="print">
<tr>
<td>
<xsl:value-of select="name()"/>
<xsl:text> id = </xsl:text>
<xsl:value-of select="./@id"/>
</td>
<td>
<xsl:for-each select="child::*">
<xsl:value-of select="./@id"/>
<xsl:text/>
</xsl:for-each>
</td>
</tr>
</xsl:template>


</xsl:stylesheet>



XSLT stylesheet 2

XML Source
<source>

<AAA id="a1" pos="start">
<BBB id="b1"/>
<BBB id="b2"/>
</AAA>
<AAA id="a2">
<BBB id="b3"/>
<BBB id="b4"/>
<CCC id="c1">
<CCC id="c2"/>
</CCC>
<BBB id="b5">
<CCC id="c3"/>
</BBB>
</AAA>

</source>

Output
<table border="1" cellpadding="6">
<tr>
<th colspan="2">Axis: descendant</th>
</tr>
<tr>
<th>Element</th>
<th>Node-set</th>
</tr>
<tr>
<td>AAA id = a1</td>
<td>b1b2</td>
</tr>
<tr>
<td>BBB id = b1</td>
<td/>
</tr>
<tr>
<td>BBB id = b2</td>
<td/>
</tr>
<tr>
<td>AAA id = a2</td>
<td>b3b4c1c2b5c3</td>
</tr>
<tr>
<td>BBB id = b3</td>
<td/>
</tr>
<tr>
<td>BBB id = b4</td>
<td/>
</tr>
<tr>
<td>CCC id = c1</td>
<td>c2</td>
</tr>
<tr>
<td>CCC id = c2</td>
<td/>
</tr>
<tr>
<td>BBB id = b5</td>
<td>c3</td>
</tr>
<tr>
<td>CCC id = c3</td>
<td/>
</tr>
</table>

HTML view
Axis: descendant
Element Node-set
AAA id = a1 b1b2
BBB id = b1
BBB id = b2
AAA id = a2 b3b4c1c2b5c3
BBB id = b3
BBB id = b4
CCC id = c1 c2
CCC id = c2
BBB id = b5 c3
CCC id = c3
XSLT stylesheet
<xsl:stylesheet version = '1.0'
xmlns:xsl='http://www.w3.org/1999/XSL/Transform'>

<xsl:template match="/">
<table border="1" cellpadding="6">
<tr>
<th colspan="2">Axis: descendant</th>
</tr>
<tr>
<th>Element</th>
<th>Node-set</th>
</tr>
<xsl:for-each select="/source//*">
<xsl:call-template name="print"/>
</xsl:for-each>
</table>
</xsl:template>

<xsl:template name="print">
<tr>
<td>
<xsl:value-of select="name()"/>
<xsl:text> id = </xsl:text>
<xsl:value-of select="./@id"/>
</td>
<td>
<xsl:for-each select="descendant::*">
<xsl:value-of select="./@id"/>
<xsl:text/>
</xsl:for-each>
</td>
</tr>
</xsl:template>


</xsl:stylesheet>



XSLT stylesheet 3

XML Source
<source>

<AAA id="a1" pos="start">
<BBB id="b1"/>
<BBB id="b2"/>
</AAA>
<AAA id="a2">
<BBB id="b3"/>
<BBB id="b4"/>
<CCC id="c1">
<CCC id="c2"/>
</CCC>
<BBB id="b5">
<CCC id="c3"/>
</BBB>
</AAA>

</source>

Output
<table border="1" cellpadding="6">
<tr>
<th colspan="2">Axis: parent</th>
</tr>
<tr>
<th>Element</th>
<th>Node-set</th>
</tr>
<tr>
<td>AAA id = a1</td>
<td>source</td>
</tr>
<tr>
<td>BBB id = b1</td>
<td>a1</td>
</tr>
<tr>
<td>BBB id = b2</td>
<td>a1</td>
</tr>
<tr>
<td>AAA id = a2</td>
<td>source</td>
</tr>
<tr>
<td>BBB id = b3</td>
<td>a2</td>
</tr>
<tr>
<td>BBB id = b4</td>
<td>a2</td>
</tr>
<tr>
<td>CCC id = c1</td>
<td>a2</td>
</tr>
<tr>
<td>CCC id = c2</td>
<td>c1</td>
</tr>
<tr>
<td>BBB id = b5</td>
<td>a2</td>
</tr>
<tr>
<td>CCC id = c3</td>
<td>b5</td>
</tr>
</table>

HTML view
Axis: parent
Element Node-set
AAA id = a1 source
BBB id = b1 a1
BBB id = b2 a1
AAA id = a2 source
BBB id = b3 a2
BBB id = b4 a2
CCC id = c1 a2
CCC id = c2 c1
BBB id = b5 a2
CCC id = c3 b5
XSLT stylesheet
<xsl:stylesheet version = '1.0'
xmlns:xsl='http://www.w3.org/1999/XSL/Transform'>

<xsl:template match="/">
<table border="1" cellpadding="6">
<tr>
<th colspan="2">Axis: parent</th>
</tr>
<tr>
<th>Element</th>
<th>Node-set</th>
</tr>
<xsl:for-each select="/source//*">
<xsl:call-template name="print"/>
</xsl:for-each>
</table>
</xsl:template>

<xsl:template name="print">
<tr>
<td>
<xsl:value-of select="name()"/>
<xsl:text> id = </xsl:text>
<xsl:value-of select="./@id"/>
</td>
<td>
<xsl:for-each select="parent::*">
<xsl:if test="not(@id)">
<xsl:value-of select="name()"/>
</xsl:if>
<xsl:value-of select="./@id"/>
<xsl:text/>
</xsl:for-each>
</td>
</tr>
</xsl:template>


</xsl:stylesheet>



XSLT stylesheet 4

XML Source
<source>

<AAA id="a1" pos="start">
<BBB id="b1"/>
<BBB id="b2"/>
</AAA>
<AAA id="a2">
<BBB id="b3"/>
<BBB id="b4"/>
<CCC id="c1">
<CCC id="c2"/>
</CCC>
<BBB id="b5">
<CCC id="c3"/>
</BBB>
</AAA>

</source>

Output
<table border="1" cellpadding="6">
<tr>
<th colspan="2">Axis: ancestor</th>
</tr>
<tr>
<th>Element</th>
<th>Node-set</th>
</tr>
<tr>
<td>AAA id = a1</td>
<td>source</td>
</tr>
<tr>
<td>BBB id = b1</td>
<td>sourcea1</td>
</tr>
<tr>
<td>BBB id = b2</td>
<td>sourcea1</td>
</tr>
<tr>
<td>AAA id = a2</td>
<td>source</td>
</tr>
<tr>
<td>BBB id = b3</td>
<td>sourcea2</td>
</tr>
<tr>
<td>BBB id = b4</td>
<td>sourcea2</td>
</tr>
<tr>
<td>CCC id = c1</td>
<td>sourcea2</td>
</tr>
<tr>
<td>CCC id = c2</td>
<td>sourcea2c1</td>
</tr>
<tr>
<td>BBB id = b5</td>
<td>sourcea2</td>
</tr>
<tr>
<td>CCC id = c3</td>
<td>sourcea2b5</td>
</tr>
</table>

HTML view
Axis: ancestor
Element Node-set
AAA id = a1 source
BBB id = b1 sourcea1
BBB id = b2 sourcea1
AAA id = a2 source
BBB id = b3 sourcea2
BBB id = b4 sourcea2
CCC id = c1 sourcea2
CCC id = c2 sourcea2c1
BBB id = b5 sourcea2
CCC id = c3 sourcea2b5
XSLT stylesheet
<xsl:stylesheet version = '1.0'
xmlns:xsl='http://www.w3.org/1999/XSL/Transform'>

<xsl:template match="/">
<table border="1" cellpadding="6">
<tr>
<th colspan="2">Axis: ancestor</th>
</tr>
<tr>
<th>Element</th>
<th>Node-set</th>
</tr>
<xsl:for-each select="/source//*">
<xsl:call-template name="print"/>
</xsl:for-each>
</table>
</xsl:template>

<xsl:template name="print">
<tr>
<td>
<xsl:value-of select="name()"/>
<xsl:text> id = </xsl:text>
<xsl:value-of select="./@id"/>
</td>
<td>
<xsl:for-each select="ancestor::*">
<xsl:if test="not(@id)">
<xsl:value-of select="name()"/>
</xsl:if>
<xsl:value-of select="./@id"/>
<xsl:text/>
</xsl:for-each>
</td>
</tr>
</xsl:template>


</xsl:stylesheet>



XSLT stylesheet 5

XML Source
<source>

<AAA id="a1" pos="start">
<BBB id="b1"/>
<BBB id="b2"/>
</AAA>
<AAA id="a2">
<BBB id="b3"/>
<BBB id="b4"/>
<CCC id="c1">
<CCC id="c2"/>
</CCC>
<BBB id="b5">
<CCC id="c3"/>
</BBB>
</AAA>

</source>

Output
<table border="1" cellpadding="6">
<tr>
<th colspan="2">Axis: following-sibling</th>
</tr>
<tr>
<th>Element</th>
<th>Node-set</th>
</tr>
<tr>
<td>AAA id = a1</td>
<td>a2</td>
</tr>
<tr>
<td>BBB id = b1</td>
<td>b2</td>
</tr>
<tr>
<td>BBB id = b2</td>
<td/>
</tr>
<tr>
<td>AAA id = a2</td>
<td/>
</tr>
<tr>
<td>BBB id = b3</td>
<td>b4c1b5</td>
</tr>
<tr>
<td>BBB id = b4</td>
<td>c1b5</td>
</tr>
<tr>
<td>CCC id = c1</td>
<td>b5</td>
</tr>
<tr>
<td>CCC id = c2</td>
<td/>
</tr>
<tr>
<td>BBB id = b5</td>
<td/>
</tr>
<tr>
<td>CCC id = c3</td>
<td/>
</tr>
</table>

HTML view
Axis: following-sibling
Element Node-set
AAA id = a1 a2
BBB id = b1 b2
BBB id = b2
AAA id = a2
BBB id = b3 b4c1b5
BBB id = b4 c1b5
CCC id = c1 b5
CCC id = c2
BBB id = b5
CCC id = c3
XSLT stylesheet
<xsl:stylesheet version = '1.0'
xmlns:xsl='http://www.w3.org/1999/XSL/Transform'>

<xsl:template match="/">
<table border="1" cellpadding="6">
<tr>
<th colspan="2">Axis: following-sibling</th>
</tr>
<tr>
<th>Element</th>
<th>Node-set</th>
</tr>
<xsl:for-each select="/source//*">
<xsl:call-template name="print"/>
</xsl:for-each>
</table>
</xsl:template>

<xsl:template name="print">
<tr>
<td>
<xsl:value-of select="name()"/>
<xsl:text> id = </xsl:text>
<xsl:value-of select="./@id"/>
</td>
<td>
<xsl:for-each select="following-sibling::*">
<xsl:if test="not(@id)">
<xsl:value-of select="name()"/>
</xsl:if>
<xsl:value-of select="./@id"/>
<xsl:text/>
</xsl:for-each>
</td>
</tr>
</xsl:template>


</xsl:stylesheet>



XSLT stylesheet 6

XML Source
<source>

<AAA id="a1" pos="start">
<BBB id="b1"/>
<BBB id="b2"/>
</AAA>
<AAA id="a2">
<BBB id="b3"/>
<BBB id="b4"/>
<CCC id="c1">
<CCC id="c2"/>
</CCC>
<BBB id="b5">
<CCC id="c3"/>
</BBB>
</AAA>

</source>

Output
<table border="1" cellpadding="6">
<tr>
<th colspan="2">Axis: preceding-sibling</th>
</tr>
<tr>
<th>Element</th>
<th>Node-set</th>
</tr>
<tr>
<td>AAA id = a1</td>
<td/>
</tr>
<tr>
<td>BBB id = b1</td>
<td/>
</tr>
<tr>
<td>BBB id = b2</td>
<td>b1</td>
</tr>
<tr>
<td>AAA id = a2</td>
<td>a1</td>
</tr>
<tr>
<td>BBB id = b3</td>
<td/>
</tr>
<tr>
<td>BBB id = b4</td>
<td>b3</td>
</tr>
<tr>
<td>CCC id = c1</td>
<td>b3b4</td>
</tr>
<tr>
<td>CCC id = c2</td>
<td/>
</tr>
<tr>
<td>BBB id = b5</td>
<td>b3b4c1</td>
</tr>
<tr>
<td>CCC id = c3</td>
<td/>
</tr>
</table>

HTML view
Axis: preceding-sibling
Element Node-set
AAA id = a1
BBB id = b1
BBB id = b2 b1
AAA id = a2 a1
BBB id = b3
BBB id = b4 b3
CCC id = c1 b3b4
CCC id = c2
BBB id = b5 b3b4c1
CCC id = c3
XSLT stylesheet
<xsl:stylesheet version = '1.0'
xmlns:xsl='http://www.w3.org/1999/XSL/Transform'>

<xsl:template match="/">
<table border="1" cellpadding="6">
<tr>
<th colspan="2">Axis: preceding-sibling</th>
</tr>
<tr>
<th>Element</th>
<th>Node-set</th>
</tr>
<xsl:for-each select="/source//*">
<xsl:call-template name="print"/>
</xsl:for-each>
</table>
</xsl:template>

<xsl:template name="print">
<tr>
<td>
<xsl:value-of select="name()"/>
<xsl:text> id = </xsl:text>
<xsl:value-of select="./@id"/>
</td>
<td>
<xsl:for-each select="preceding-sibling::*">
<xsl:if test="not(@id)">
<xsl:value-of select="name()"/>
</xsl:if>
<xsl:value-of select="./@id"/>
<xsl:text/>
</xsl:for-each>
</td>
</tr>
</xsl:template>


</xsl:stylesheet>



XSLT stylesheet 7

XML Source
<source>

<AAA id="a1" pos="start">
<BBB id="b1"/>
<BBB id="b2"/>
</AAA>
<AAA id="a2">
<BBB id="b3"/>
<BBB id="b4"/>
<CCC id="c1">
<CCC id="c2"/>
</CCC>
<BBB id="b5">
<CCC id="c3"/>
</BBB>
</AAA>

</source>

Output
<table border="1" cellpadding="6">
<tr>
<th colspan="2">Axis: following</th>
</tr>
<tr>
<th>Element</th>
<th>Node-set</th>
</tr>
<tr>
<td>AAA id = a1</td>
<td>a2b3b4c1c2b5c3</td>
</tr>
<tr>
<td>BBB id = b1</td>
<td>b2a2b3b4c1c2b5c3</td>
</tr>
<tr>
<td>BBB id = b2</td>
<td>a2b3b4c1c2b5c3</td>
</tr>
<tr>
<td>AAA id = a2</td>
<td/>
</tr>
<tr>
<td>BBB id = b3</td>
<td>b4c1c2b5c3</td>
</tr>
<tr>
<td>BBB id = b4</td>
<td>c1c2b5c3</td>
</tr>
<tr>
<td>CCC id = c1</td>
<td>b5c3</td>
</tr>
<tr>
<td>CCC id = c2</td>
<td>b5c3</td>
</tr>
<tr>
<td>BBB id = b5</td>
<td/>
</tr>
<tr>
<td>CCC id = c3</td>
<td/>
</tr>
</table>

HTML view
Axis: following
Element Node-set
AAA id = a1 a2b3b4c1c2b5c3
BBB id = b1 b2a2b3b4c1c2b5c3
BBB id = b2 a2b3b4c1c2b5c3
AAA id = a2
BBB id = b3 b4c1c2b5c3
BBB id = b4 c1c2b5c3
CCC id = c1 b5c3
CCC id = c2 b5c3
BBB id = b5
CCC id = c3
XSLT stylesheet
<xsl:stylesheet version = '1.0'
xmlns:xsl='http://www.w3.org/1999/XSL/Transform'>

<xsl:template match="/">
<table border="1" cellpadding="6">
<tr>
<th colspan="2">Axis: following</th>
</tr>
<tr>
<th>Element</th>
<th>Node-set</th>
</tr>
<xsl:for-each select="/source//*">
<xsl:call-template name="print"/>
</xsl:for-each>
</table>
</xsl:template>

<xsl:template name="print">
<tr>
<td>
<xsl:value-of select="name()"/>
<xsl:text> id = </xsl:text>
<xsl:value-of select="./@id"/>
</td>
<td>
<xsl:for-each select="following::*">
<xsl:if test="not(@id)">
<xsl:value-of select="name()"/>
</xsl:if>
<xsl:value-of select="./@id"/>
<xsl:text/>
</xsl:for-each>
</td>
</tr>
</xsl:template>


</xsl:stylesheet>



XSLT stylesheet 8

XML Source
<source>

<AAA id="a1" pos="start">
<BBB id="b1"/>
<BBB id="b2"/>
</AAA>
<AAA id="a2">
<BBB id="b3"/>
<BBB id="b4"/>
<CCC id="c1">
<CCC id="c2"/>
</CCC>
<BBB id="b5">
<CCC id="c3"/>
</BBB>
</AAA>

</source>

Output
<table border="1" cellpadding="6">
<tr>
<th colspan="2">Axis: preceding</th>
</tr>
<tr>
<th>Element</th>
<th>Node-set</th>
</tr>
<tr>
<td>AAA id = a1</td>
<td/>
</tr>
<tr>
<td>BBB id = b1</td>
<td/>
</tr>
<tr>
<td>BBB id = b2</td>
<td>b1</td>
</tr>
<tr>
<td>AAA id = a2</td>
<td>a1b1b2</td>
</tr>
<tr>
<td>BBB id = b3</td>
<td>a1b1b2</td>
</tr>
<tr>
<td>BBB id = b4</td>
<td>a1b1b2b3</td>
</tr>
<tr>
<td>CCC id = c1</td>
<td>a1b1b2b3b4</td>
</tr>
<tr>
<td>CCC id = c2</td>
<td>a1b1b2b3b4</td>
</tr>
<tr>
<td>BBB id = b5</td>
<td>a1b1b2b3b4c1c2</td>
</tr>
<tr>
<td>CCC id = c3</td>
<td>a1b1b2b3b4c1c2</td>
</tr>
</table>

HTML view
Axis: preceding
Element Node-set
AAA id = a1
BBB id = b1
BBB id = b2 b1
AAA id = a2 a1b1b2
BBB id = b3 a1b1b2
BBB id = b4 a1b1b2b3
CCC id = c1 a1b1b2b3b4
CCC id = c2 a1b1b2b3b4
BBB id = b5 a1b1b2b3b4c1c2
CCC id = c3 a1b1b2b3b4c1c2
XSLT stylesheet
<xsl:stylesheet version = '1.0'
xmlns:xsl='http://www.w3.org/1999/XSL/Transform'>

<xsl:template match="/">
<table border="1" cellpadding="6">
<tr>
<th colspan="2">Axis: preceding</th>
</tr>
<tr>
<th>Element</th>
<th>Node-set</th>
</tr>
<xsl:for-each select="/source//*">
<xsl:call-template name="print"/>
</xsl:for-each>
</table>
</xsl:template>

<xsl:template name="print">
<tr>
<td>
<xsl:value-of select="name()"/>
<xsl:text> id = </xsl:text>
<xsl:value-of select="./@id"/>
</td>
<td>
<xsl:for-each select="preceding::*">
<xsl:if test="not(@id)">
<xsl:value-of select="name()"/>
</xsl:if>
<xsl:value-of select="./@id"/>
<xsl:text/>
</xsl:for-each>
</td>
</tr>
</xsl:template>


</xsl:stylesheet>



XSLT stylesheet 9

XML Source
<source>

<AAA id="a1" pos="start">
<BBB id="b1"/>
<BBB id="b2"/>
</AAA>
<AAA id="a2">
<BBB id="b3"/>
<BBB id="b4"/>
<CCC id="c1">
<CCC id="c2"/>
</CCC>
<BBB id="b5">
<CCC id="c3"/>
</BBB>
</AAA>

</source>

Output
<table border="1" cellpadding="6">
<tr>
<th colspan="2">Axis: attribute</th>
</tr>
<tr>
<th>Element</th>
<th>Node-set</th>
</tr>
<tr>
<td>AAA id = a1</td>
<td>idpos</td>
</tr>
<tr>
<td>BBB id = b1</td>
<td>id</td>
</tr>
<tr>
<td>BBB id = b2</td>
<td>id</td>
</tr>
<tr>
<td>AAA id = a2</td>
<td>id</td>
</tr>
<tr>
<td>BBB id = b3</td>
<td>id</td>
</tr>
<tr>
<td>BBB id = b4</td>
<td>id</td>
</tr>
<tr>
<td>CCC id = c1</td>
<td>id</td>
</tr>
<tr>
<td>CCC id = c2</td>
<td>id</td>
</tr>
<tr>
<td>BBB id = b5</td>
<td>id</td>
</tr>
<tr>
<td>CCC id = c3</td>
<td>id</td>
</tr>
</table>

HTML view
Axis: attribute
Element Node-set
AAA id = a1 idpos
BBB id = b1 id
BBB id = b2 id
AAA id = a2 id
BBB id = b3 id
BBB id = b4 id
CCC id = c1 id
CCC id = c2 id
BBB id = b5 id
CCC id = c3 id
XSLT stylesheet
<xsl:stylesheet version = '1.0'
xmlns:xsl='http://www.w3.org/1999/XSL/Transform'>

<xsl:template match="/">
<table border="1" cellpadding="6">
<tr>
<th colspan="2">Axis: attribute</th>
</tr>
<tr>
<th>Element</th>
<th>Node-set</th>
</tr>
<xsl:for-each select="/source//*">
<xsl:call-template name="print"/>
</xsl:for-each>
</table>
</xsl:template>

<xsl:template name="print">
<tr>
<td>
<xsl:value-of select="name()"/>
<xsl:text> id = </xsl:text>
<xsl:value-of select="./@id"/>
</td>
<td>
<xsl:for-each select="attribute::*">
<xsl:if test="not(@id)">
<xsl:value-of select="name()"/>
</xsl:if>
<xsl:value-of select="./@id"/>
<xsl:text/>
</xsl:for-each>
</td>
</tr>
</xsl:template>


</xsl:stylesheet>



XSLT stylesheet 10

XML Source
<source>

<AAA id="a1" pos="start">
<BBB id="b1"/>
<BBB id="b2"/>
</AAA>
<AAA id="a2">
<BBB id="b3"/>
<BBB id="b4"/>
<CCC id="c1">
<CCC id="c2"/>
</CCC>
<BBB id="b5">
<CCC id="c3"/>
</BBB>
</AAA>

</source>

Output
<table border="1" cellpadding="6">
<tr>
<th colspan="2">Axis: namespace</th>
</tr>
<tr>
<th>Element</th>
<th>Node-set</th>
</tr>
<tr>
<td>AAA id = a1</td>
<td>xml</td>
</tr>
<tr>
<td>BBB id = b1</td>
<td>xml</td>
</tr>
<tr>
<td>BBB id = b2</td>
<td>xml</td>
</tr>
<tr>
<td>AAA id = a2</td>
<td>xml</td>
</tr>
<tr>
<td>BBB id = b3</td>
<td>xml</td>
</tr>
<tr>
<td>BBB id = b4</td>
<td>xml</td>
</tr>
<tr>
<td>CCC id = c1</td>
<td>xml</td>
</tr>
<tr>
<td>CCC id = c2</td>
<td>xml</td>
</tr>
<tr>
<td>BBB id = b5</td>
<td>xml</td>
</tr>
<tr>
<td>CCC id = c3</td>
<td>xml</td>
</tr>
</table>

HTML view
Axis: namespace
Element Node-set
AAA id = a1 xml
BBB id = b1 xml
BBB id = b2 xml
AAA id = a2 xml
BBB id = b3 xml
BBB id = b4 xml
CCC id = c1 xml
CCC id = c2 xml
BBB id = b5 xml
CCC id = c3 xml
XSLT stylesheet
<xsl:stylesheet version = '1.0'
xmlns:xsl='http://www.w3.org/1999/XSL/Transform'>

<xsl:template match="/">
<table border="1" cellpadding="6">
<tr>
<th colspan="2">Axis: namespace</th>
</tr>
<tr>
<th>Element</th>
<th>Node-set</th>
</tr>
<xsl:for-each select="/source//*">
<xsl:call-template name="print"/>
</xsl:for-each>
</table>
</xsl:template>

<xsl:template name="print">
<tr>
<td>
<xsl:value-of select="name()"/>
<xsl:text> id = </xsl:text>
<xsl:value-of select="./@id"/>
</td>
<td>
<xsl:for-each select="namespace::*">
<xsl:if test="not(@id)">
<xsl:value-of select="name()"/>
</xsl:if>
<xsl:value-of select="./@id"/>
<xsl:text/>
</xsl:for-each>
</td>
</tr>
</xsl:template>


</xsl:stylesheet>



XSLT stylesheet 11

XML Source
<source>

<AAA id="a1" pos="start">
<BBB id="b1"/>
<BBB id="b2"/>
</AAA>
<AAA id="a2">
<BBB id="b3"/>
<BBB id="b4"/>
<CCC id="c1">
<CCC id="c2"/>
</CCC>
<BBB id="b5">
<CCC id="c3"/>
</BBB>
</AAA>

</source>

Output
<table border="1" cellpadding="6">
<tr>
<th colspan="2">Axis: self</th>
</tr>
<tr>
<th>Element</th>
<th>Node-set</th>
</tr>
<tr>
<td>AAA id = a1</td>
<td>a1</td>
</tr>
<tr>
<td>BBB id = b1</td>
<td>b1</td>
</tr>
<tr>
<td>BBB id = b2</td>
<td>b2</td>
</tr>
<tr>
<td>AAA id = a2</td>
<td>a2</td>
</tr>
<tr>
<td>BBB id = b3</td>
<td>b3</td>
</tr>
<tr>
<td>BBB id = b4</td>
<td>b4</td>
</tr>
<tr>
<td>CCC id = c1</td>
<td>c1</td>
</tr>
<tr>
<td>CCC id = c2</td>
<td>c2</td>
</tr>
<tr>
<td>BBB id = b5</td>
<td>b5</td>
</tr>
<tr>
<td>CCC id = c3</td>
<td>c3</td>
</tr>
</table>

HTML view
Axis: self
Element Node-set
AAA id = a1 a1
BBB id = b1 b1
BBB id = b2 b2
AAA id = a2 a2
BBB id = b3 b3
BBB id = b4 b4
CCC id = c1 c1
CCC id = c2 c2
BBB id = b5 b5
CCC id = c3 c3
XSLT stylesheet
<xsl:stylesheet version = '1.0'
xmlns:xsl='http://www.w3.org/1999/XSL/Transform'>

<xsl:template match="/">
<table border="1" cellpadding="6">
<tr>
<th colspan="2">Axis: self</th>
</tr>
<tr>
<th>Element</th>
<th>Node-set</th>
</tr>
<xsl:for-each select="/source//*">
<xsl:call-template name="print"/>
</xsl:for-each>
</table>
</xsl:template>

<xsl:template name="print">
<tr>
<td>
<xsl:value-of select="name()"/>
<xsl:text> id = </xsl:text>
<xsl:value-of select="./@id"/>
</td>
<td>
<xsl:for-each select="self::*">
<xsl:if test="not(@id)">
<xsl:value-of select="name()"/>
</xsl:if>
<xsl:value-of select="./@id"/>
<xsl:text/>
</xsl:for-each>
</td>
</tr>
</xsl:template>


</xsl:stylesheet>



XSLT stylesheet 12

XML Source
<source>

<AAA id="a1" pos="start">
<BBB id="b1"/>
<BBB id="b2"/>
</AAA>
<AAA id="a2">
<BBB id="b3"/>
<BBB id="b4"/>
<CCC id="c1">
<CCC id="c2"/>
</CCC>
<BBB id="b5">
<CCC id="c3"/>
</BBB>
</AAA>

</source>

Output
<table border="1" cellpadding="6">
<tr>
<th colspan="2">Axis: descendant-or-self</th>
</tr>
<tr>
<th>Element</th>
<th>Node-set</th>
</tr>
<tr>
<td>AAA id = a1</td>
<td>a1b1b2</td>
</tr>
<tr>
<td>BBB id = b1</td>
<td>b1</td>
</tr>
<tr>
<td>BBB id = b2</td>
<td>b2</td>
</tr>
<tr>
<td>AAA id = a2</td>
<td>a2b3b4c1c2b5c3</td>
</tr>
<tr>
<td>BBB id = b3</td>
<td>b3</td>
</tr>
<tr>
<td>BBB id = b4</td>
<td>b4</td>
</tr>
<tr>
<td>CCC id = c1</td>
<td>c1c2</td>
</tr>
<tr>
<td>CCC id = c2</td>
<td>c2</td>
</tr>
<tr>
<td>BBB id = b5</td>
<td>b5c3</td>
</tr>
<tr>
<td>CCC id = c3</td>
<td>c3</td>
</tr>
</table>

HTML view
Axis: descendant-or-self
Element Node-set
AAA id = a1 a1b1b2
BBB id = b1 b1
BBB id = b2 b2
AAA id = a2 a2b3b4c1c2b5c3
BBB id = b3 b3
BBB id = b4 b4
CCC id = c1 c1c2
CCC id = c2 c2
BBB id = b5 b5c3
CCC id = c3 c3
XSLT stylesheet
<xsl:stylesheet version = '1.0'
xmlns:xsl='http://www.w3.org/1999/XSL/Transform'>

<xsl:template match="/">
<table border="1" cellpadding="6">
<tr>
<th colspan="2">Axis: descendant-or-self</th>
</tr>
<tr>
<th>Element</th>
<th>Node-set</th>
</tr>
<xsl:for-each select="/source//*">
<xsl:call-template name="print"/>
</xsl:for-each>
</table>
</xsl:template>

<xsl:template name="print">
<tr>
<td>
<xsl:value-of select="name()"/>
<xsl:text> id = </xsl:text>
<xsl:value-of select="./@id"/>
</td>
<td>
<xsl:for-each select="descendant-or-self::*">
<xsl:if test="not(@id)">
<xsl:value-of select="name()"/>
</xsl:if>
<xsl:value-of select="./@id"/>
<xsl:text/>
</xsl:for-each>
</td>
</tr>
</xsl:template>


</xsl:stylesheet>



XSLT stylesheet 13

XML Source
<source>

<AAA id="a1" pos="start">
<BBB id="b1"/>
<BBB id="b2"/>
</AAA>
<AAA id="a2">
<BBB id="b3"/>
<BBB id="b4"/>
<CCC id="c1">
<CCC id="c2"/>
</CCC>
<BBB id="b5">
<CCC id="c3"/>
</BBB>
</AAA>

</source>

Output
<table border="1" cellpadding="6">
<tr>
<th colspan="2">Axis: ancestor-or-self </th>
</tr>
<tr>
<th>Element</th>
<th>Node-set</th>
</tr>
<tr>
<td>AAA id = a1</td>
<td>sourcea1</td>
</tr>
<tr>
<td>BBB id = b1</td>
<td>sourcea1b1</td>
</tr>
<tr>
<td>BBB id = b2</td>
<td>sourcea1b2</td>
</tr>
<tr>
<td>AAA id = a2</td>
<td>sourcea2</td>
</tr>
<tr>
<td>BBB id = b3</td>
<td>sourcea2b3</td>
</tr>
<tr>
<td>BBB id = b4</td>
<td>sourcea2b4</td>
</tr>
<tr>
<td>CCC id = c1</td>
<td>sourcea2c1</td>
</tr>
<tr>
<td>CCC id = c2</td>
<td>sourcea2c1c2</td>
</tr>
<tr>
<td>BBB id = b5</td>
<td>sourcea2b5</td>
</tr>
<tr>
<td>CCC id = c3</td>
<td>sourcea2b5c3</td>
</tr>
</table>

HTML view
Axis: ancestor-or-self
Element Node-set
AAA id = a1 sourcea1
BBB id = b1 sourcea1b1
BBB id = b2 sourcea1b2
AAA id = a2 sourcea2
BBB id = b3 sourcea2b3
BBB id = b4 sourcea2b4
CCC id = c1 sourcea2c1
CCC id = c2 sourcea2c1c2
BBB id = b5 sourcea2b5
CCC id = c3 sourcea2b5c3
XSLT stylesheet
<xsl:stylesheet version = '1.0'
xmlns:xsl='http://www.w3.org/1999/XSL/Transform'>

<xsl:template match="/">
<table border="1" cellpadding="6">
<tr>
<th colspan="2">Axis: ancestor-or-self </th>
</tr>
<tr>
<th>Element</th>
<th>Node-set</th>
</tr>
<xsl:for-each select="/source//*">
<xsl:call-template name="print"/>
</xsl:for-each>
</table>
</xsl:template>

<xsl:template name="print">
<tr>
<td>
<xsl:value-of select="name()"/>
<xsl:text> id = </xsl:text>
<xsl:value-of select="./@id"/>
</td>
<td>
<xsl:for-each select="ancestor-or-self ::*">
<xsl:if test="not(@id)">
<xsl:value-of select="name()"/>
</xsl:if>
<xsl:value-of select="./@id"/>
<xsl:text/>
</xsl:for-each>
</td>
</tr>
</xsl:template>


</xsl:stylesheet>

4-19-2013

4-19-2013

kevin carr city of stantonkevin carr city of stantonkevin carr city of stantonkevin carr city of stantonSales Tax Measure GG City of Stantonkevin carr city of stantonkevin carr city of stantonkevin carr city of stantonkevin carr city of stanton


free stock videos
iphone battery cases

Kevin Carr Stanton with Governor Brown Kevin Carr with CA CFO John Chaing Kevin Carr with Congresswoman Loretta Sanchez Kevin Carr with CA State Senator Joe Dunn

Billabong Board Shorts
Quicksilver Board Shorts
I got a new iPhone5 battery case that I found on the web. I have a new ipad and I just love it. My new HTC One cellphone is awesome. I ordered a new iphone5 and I can't wait to get it. The smartphone charger I purchased is exactly what I needed. The new HTC phone is the best. I need more used AOL disks for my computer. The new emerica shoe has a new larger display.
hawaiian sandal
dekline
true religion bootcut billy jeans
hawaiian sandals

Rigoberto Ramirez

I found a iphone battery cases to get a battery backup chargers. That's why there are portable power packs—when the power is out.

I reviewed the clothing at iphone battery cases and found the best Active clothing available.

I ordered the plumber orange county and a incase backpack then I bought the backpack icon from Incase.

Buy womens cowboy boots humu on the web store 1cecilia165 humu shoe and order a few.

These are the shops to visit:

  1. Sandals from hawaii
  2. hawaiian leather sandal
  3. hawaiian leather sandal
  4. skate footwear
true religion bootcut billy jeans
Quicksilver surf clothing Board Shorts



skateboard
David Cadena Stanton
iPhone 6 plus battery pack
There is the 1cecilia181 for my car and the 1cecilia182 for my other car and the 1cecilia183 for my wife's car. The new Baby Doll sexy looking lingerie is the best one to get. The new Baby Doll sexy lingerie looks great. The new the bridal chemises from In Bloom is the best around.

Also, you will want to check out Stanton California so you can see what's up and they are part of Stanton City Hall as well.

You can also get Organic Skin Care products from Bliss Bath Body and you must check out their Natural Body Lotions and bath soaps

Now if you are looking for the best deals

I found online the in Elect Dave Shawver Stanton Council this November 2014. Elect march madness ncaa and internetusers this November 2014.

delivered.

These are the shops to visit:

  1. Sandals from hawaii
  2. hawaiian leather sandal
  3. hawaiian leather sandal
  4. skate footwear

I ordered the plumber orange county and a incase backpack then I bought the backpack icon from Incase.

Buy womens cowboy boots humu on the web store 1cecilia165 humu shoe and order a few.

I found a hawaiian sandal and another Rigoberto Ramirez on this hawaiian Sandal website.



a true religion bootcut billy jeans and

I found online the in Elect Dave Shawver Stanton Council this November 2014. Elect march madness ncaa and internetusers this November 2014.

delivered.

These are the shops to visit:

  1. Sandals from hawaii
  2. hawaiian leather sandal
  3. hawaiian leather sandal
  4. skate footwear

I ordered the plumber orange county and a incase backpack then I bought the backpack icon from Incase.

Buy womens cowboy boots humu on the web store 1cecilia165 humu shoe and order a few.

I found a hawaiian sandal and another Rigoberto Ramirez on this hawaiian Sandal website.



a true religion bootcut billy jeans and
Hey, check out this Organic Skin Care European Soaps along with Natural Lavender Body Lotion and shea butter

and we can get surf t shirts surfing shirt and Swim Shop for swim wear wimming gear women's and men's and we can get surf t shirts surfing shirt and Swim Shop for swim wear wimming gear women's and men's