F
FaensenD
Consider the following XML document
<root>
<PersonStreet>24 Miller Street</PersonStreet>
<PersonZIP>12345</PersonZIP>
<PersonCity>Munich</PersonCity>
<CompanyStreet>24 Miller Street</CompanyStreet>
<CompanyZIP>12345</CompanyZIP>
<CompanyCity>Munich</CompanyCity>
</root>
In a template I want to access the nodes that are prefixed by a given
parameter.
The following doesn't work but should illustrate what I mean.
<xsl:template name="address">
<xslaram name="prefix/>
<xsl:element name="{$prefix}">
<xsl:value-of select=$prefix + "Street" />
<xsl:value-of select=$prefix + "ZIP" />
<xsl:value-of select=$prefix + "City" />
</xsl:element>
</xsl:template>
Is it possible to create such an XPath expression dynamically?
Thank you
Daniel Faensen
<root>
<PersonStreet>24 Miller Street</PersonStreet>
<PersonZIP>12345</PersonZIP>
<PersonCity>Munich</PersonCity>
<CompanyStreet>24 Miller Street</CompanyStreet>
<CompanyZIP>12345</CompanyZIP>
<CompanyCity>Munich</CompanyCity>
</root>
In a template I want to access the nodes that are prefixed by a given
parameter.
The following doesn't work but should illustrate what I mean.
<xsl:template name="address">
<xslaram name="prefix/>
<xsl:element name="{$prefix}">
<xsl:value-of select=$prefix + "Street" />
<xsl:value-of select=$prefix + "ZIP" />
<xsl:value-of select=$prefix + "City" />
</xsl:element>
</xsl:template>
Is it possible to create such an XPath expression dynamically?
Thank you
Daniel Faensen