I'm attempting to import a node set and then search the input stream and do a replace on a match of a value.
<xsl:variable name="root" select="/"/>
<xsl:variable name="myNodeSet" select="collection('file:/C:/temp/?select=*.xml;recurse=yes')"/>
<xsl:template match="node()|@*">
<xsl:copy>
<xsl:apply-templates select="node()|@*"/>
</xsl:copy>
</xsl:template>
<xsl:template match="someElement/@name">
<xsl:attribute name="name">
<xsl:if test=".=$myNodeSet//matchName">
<!-- here is where I'm trying to replace someElement/@name with a sibling attribute value -->
<!-- of the matched node in the if test -->
<xsl:value-of select="$entities/preferredAbbreviation[text()=.]/../Entity/@name"/>
</xsl:if>
</xsl:attribute>
</xsl:template>
unfortunately, it doesn't seem to work and I'm sure it has something to do with attempts to reference the test match of the if statement. should I be using a for-each instead here?
thanks a bunch.
No comments:
Post a Comment