Altova Mailing List Archives>Archive Index >microsoft.public.xsl Archive Home >Recent entries [Thread Prev] >Thread Next - Re: Performance referencing global parameter data Performance referencing global parameter dataTo: NULL Date: 1/3/2007 10:09:00 AM
To the best of my knowledge, there is no way in XSL 1.0 to key values
passed in a global parameter since xsl:key will not accept variables.
So I am left with the worst performing aspect of my xsl being lookups
to parameterized configuration information which looks like:
<xsl:param name="config">
<documentType miscControlAttributes="">
<itemName miscControlAttributes=""/>
<itemName2 miscControlAttributes=""/>
</documentType>
</xsl:param>
The configuration is then stored as a nodeset
<xsl:variable name="configuration-nodeset"
select="msxsl:node-set($configuration)"/>
For each documentType node in the input, I retrieve the document level
configuration into a variable:
<xsl:variable name="documentConfiguration"
select="$configuration-nodeset/*[translate(name(), $lc,
$uc)=translate(current()/@form,$lc,$uc)]"/>
The document nodes are, unfortunately, case insensitive coming from the
source, so I have to perform a translation to upper case for
comparison.
The template for processing document items is called, passing in the
document configuration
<xsl:apply-templates select="*">
<xsl:with-param name="documentConfiguration"
select="$documentConfiguration"/>
</xsl:apply-templates>
The document item template then does a lookup to the item configuration
<xsl:template match="d:item">
<xsl:param name="documentConfiguration"/>
<xsl:variable name="itemConfiguration"
select="$documentConfiguration/*[translate(name(),$lc,$uc)=translate($normalizedElementName,$lc,$uc)]"/>
</xsl:template>
Does anyone know of a better pattern for looking up parameterized
configuration info that is compatible with XSL 1.0?
| ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
