XML
<root>
<Algemeen>
<foto>
<foe>
<fee>
<img src="www.blah.com/sample.jif"></img>
</fee>
</foe>
</foto>
</Algemeen>
</root>
XSLT
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<result>
<xsl:apply-templates select="/root/Algemeen/foto/foe/fee/img"/>
</result>
</xsl:template>
<!--specific template match for this img -->
<xsl:template match="/root/Algemeen/foto/foe/fee/img">
<xsl:copy>
<xsl:attribute name="width">100</xsl:attribute>
<xsl:apply-templates select="@*|node()" />
</xsl:copy>
</xsl:template>
<!--Identity template copies content forward -->
<xsl:template match="@*|node()">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>
I'm adding an attribute to "img" tag via template, how can i get the whole "foto" node? is this "@*|node()" refers to 2nd level parent node "foe"?
viewed links: