Altova Mailing List Archives>Archive Index >comp.text.xml Archive Home >Recent entries >Thread Prev - nested xsl:for-each with document function >Thread Next - Re: nested xsl:for-each with document function Re: nested xsl:for-each with document functionTo: NULL Date: 9/10/2009 1:55:00 PM Cozmo wrote:
> 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"/>
> <xsl:otherwise>
> <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>
> </xsl:otherwise>
> </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!
So you have two XML input documents and want to process them and compare
nodes. Please show us relevant sample of the two documents and explain
the XML output you want the stylesheet to create for those two samples.
--
Martin Honnen
http://msmvps.com/blogs/martin_honnen/
| ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
