[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Modifying a variable while merging 2 XMLs document

Subject: Re: Modifying a variable while merging 2 XMLs documents !?
From: David Carlisle <davidc@xxxxxxxxx>
Date: Thu, 16 Mar 2006 16:21:47 GMT
modifying xslt variable
> For that, I used a variable which I change once I copy.

You can not change the value of a variable once it is bound.
    <xsl:variable name="no_value_nl" select="string-length ($value_nl) &lt; 1"/>
..... 
    <xsl:variable name="no_value_nl" select="false"/>
   </xsl:if>

This should generate an error message in xslt1, in xslt2 it's allowed
(but the second is essentially an unrelated variable that happens to
have the same name) The variable goes out of scope immediately at the
</xsl:if> as the scope of a variable in xslt is always the surrounding
element. Also select="false" selects a child <false> element but I
suspect you meant the boolean select="false()"

I think you just want something like

    <xsl:copy>
    <xsl:variable name="value_fr" select="value[@xml:lang='fr']"/>
    <xsl:variable name="value_en" select="value[@xml:lang='en']"/>
    <xsl:apply-templates select="@*|node()"/>
    <xsl:copy-of
    select="self::*[not(value/xml:lang='nl')]/
                  document('glossaryNL.xml')/
                  *[value[@xml:lang='en']=$value_en][value[@xml:lang='fr']=$value_fr]/
                   value[@xml:lang='nl']"/>

     </xsl:copy>

David

________________________________________________________________________
This e-mail has been scanned for all viruses by Star. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2011 All Rights Reserved.