I have the following xml structure (It is much longer and compicated in the real example)
<document>
<node1>
<child1/>
<child2/>
...
</node1>
<anotherNode />
</document>
I want to create a template like
<xsl:template match="node1" mode="node1">
<img alt="" src="{child1}" />
...
...
</xsl:template>
and to apply this template in another template like this
<xsl:template match="anotherNode">
<xsl:apply-templates select="node1" mode="node1" />
</xsl:template>
If the node1 tag had parent that would be easy to do, but I can’t figure out how to match and apply template if it does not have a parent.
Use:
Or alternatively: