C
Cozmo
Hello,
I want to do a nested xsl:for-each with the document function.
Here is a code snippet but it is not working:
<xsl:variable name="cc" select="lower-case(../code-2)"/>
<xsl:variable name="names_DA" select="document('export.xml')/
translation/record[iso.code2=$cc]"/>
<xsl:variable name="lgs" select="lg.vers"/>
<xsl:for-each select="$names_DA">
<xsl:for-each select="$lgs">
<xsl:choose>
<xsl:when test="@lg=$names_DA/source.lang"/>
<xsltherwise>
<xsl:element name="lg.vers">
<xsl:attribute name="lg"><xsl:value-of select="$names_DA/
source.lang"/></xsl:attribute>
<xsl:value-of select="$names_DA/short.name"/>
</xsl:element>
</xsltherwise>
</xsl:choose>
</xsl:for-each>
</xsl:for-each>
The problem I have is that I have to run through all entries of the
external document (with restriction) and afterwards check the other
restrictions in the second for-each. I want to check if the entries
already exists and if not I have to add them out of the external
docoument.
if I use this one:
<xsl:value-of select="$names_DA/short.name"/>
I get entries but it returns the complete records and not only the
current one of the for-each loop.
Hope this explains the problem. Would be happy for any help!
Thanks a lot.
Cozmo
I want to do a nested xsl:for-each with the document function.
Here is a code snippet but it is not working:
<xsl:variable name="cc" select="lower-case(../code-2)"/>
<xsl:variable name="names_DA" select="document('export.xml')/
translation/record[iso.code2=$cc]"/>
<xsl:variable name="lgs" select="lg.vers"/>
<xsl:for-each select="$names_DA">
<xsl:for-each select="$lgs">
<xsl:choose>
<xsl:when test="@lg=$names_DA/source.lang"/>
<xsltherwise>
<xsl:element name="lg.vers">
<xsl:attribute name="lg"><xsl:value-of select="$names_DA/
source.lang"/></xsl:attribute>
<xsl:value-of select="$names_DA/short.name"/>
</xsl:element>
</xsltherwise>
</xsl:choose>
</xsl:for-each>
</xsl:for-each>
The problem I have is that I have to run through all entries of the
external document (with restriction) and afterwards check the other
restrictions in the second for-each. I want to check if the entries
already exists and if not I have to add them out of the external
docoument.
if I use this one:
<xsl:value-of select="$names_DA/short.name"/>
I get entries but it returns the complete records and not only the
current one of the for-each loop.
Hope this explains the problem. Would be happy for any help!
Thanks a lot.
Cozmo