Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


question on XSL variables

From: "El Durango" <El_Durango@-----.--->
To: NULL
Date: 11/2/2005 12:56:00 AM
I don't know if this is the right area for this post but I have a stylesheet 
that I use to render XML to another format.  At the moment I need to have a 
variable set to a particular XPath based on a certain test case derived from 
the XML file.

So I would have something like

<xsl:template name="A">
    <xsl:choose>
        <xsl:when test="(insert logic expression)">
            <xsl:variable name="myVar" select="(insert Xpath expression)"/>
        </xsl:when>
        <xsl:otherwise>
            <xsl:variable name="myVar" select="(insert other Xpath 
expression)"/>
        </xsl:otherwise>
    </xsl:choose>
</xsl:template>

Now this is just pseudocode I put up but the problem I have is that the 
variable will be out of scope and if I do declare it above the <xsl:choose> 
statement it will not work either, I assume since XSL variable cannot be 
reassigned.

Anyway I am an XSL newbie as you can tell any proper way of setting a 
variable based on a conditional statement?

Thank you for your replies. 




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