Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: nested xsl:for-each with document function

From: Martin Honnen <mahotrash@-----.-->
To: 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/


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent