Hi folks,
I want to write a XSLT gets properties e.g. XPath-Expression from one file and apply it to a different one. I tried this:
Code:
<rule>
<xpath attribute1="p1" attribute2="p1_"/>
<xpath attribute1="p2" attribute2="p2_"/>
</rule>
Code:
<test>
<p1/>
<p2/>
<p3/>
</test>
Code:
<test>
<p1_/>
<p2_/>
<p3/>
</test>
Code:
<xsl:param name="document" select="document('XMLfile.xml')"/>
<xsl:template match="/rule//xpath">
<xsl:apply-templates select="$document" mode="document_">
<xsl:with-param name="attribute1" select="./@attribute1" tunnel="yes"/>
<xsl:with-param name="attribute2" select="./@attribute2" tunnel="yes"/>
</xsl:apply-templates>
</xsl:template>
<xsl:template match="/" mode="document_">
<xsl:param name="attribute1"/>
xsl:apply-templates select="$attribute1" mode="tag_"/>
</xsl:template>
<xsl:template match="p1" mode="tag_">
<xsl:param name="attribute2"/>
<xsl:element name="{$attribute2}"/>
</xsl:template>
The code is not complete, but I failure to apply the p1-template. Could anybody help me?[u]</u>[u]</u>[u]</u>[u]</u>
Thanks a lot.
Clyne