I
IanK
I have a file called product.xml as follows:
<products>
<product name="Maxi-ISA" friendlyname="Isa" />
<product name="PEP" friendlyname="Personal Equity Plan" />
<product name="General" friendlyname="General account" />
<product name="Pension" friendlyname="Pension drawdown" />
</products>
This is a file that maps product names (the "name" field) onto
user-friendly names (friendlyname) that can be used in client
documentation. I have the following code in my XSL function file that
tries to reference it. It is not working - what am I doing wrong?
<xsl:key name="product_name" match="product" use="@name"/>
<xsl:variable name="products" select="document('product.xml')"/>
<xsl:template name="nucleus_friendly_productname">
<xslaram name="product_name_in"/>
<xsl:for-each select="document('products.xml')">
<xsl:variable name="product" select="key('product_name',
$product_name_in)"/>
<xsl:value-of select="$product/@friendlyname"/>
</xsl:for-each>
</xsl:template>
<products>
<product name="Maxi-ISA" friendlyname="Isa" />
<product name="PEP" friendlyname="Personal Equity Plan" />
<product name="General" friendlyname="General account" />
<product name="Pension" friendlyname="Pension drawdown" />
</products>
This is a file that maps product names (the "name" field) onto
user-friendly names (friendlyname) that can be used in client
documentation. I have the following code in my XSL function file that
tries to reference it. It is not working - what am I doing wrong?
<xsl:key name="product_name" match="product" use="@name"/>
<xsl:variable name="products" select="document('product.xml')"/>
<xsl:template name="nucleus_friendly_productname">
<xslaram name="product_name_in"/>
<xsl:for-each select="document('products.xml')">
<xsl:variable name="product" select="key('product_name',
$product_name_in)"/>
<xsl:value-of select="$product/@friendlyname"/>
</xsl:for-each>
</xsl:template>