Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > XML > question on XSL variables

Reply
Thread Tools

question on XSL variables

 
 
El Durango
Guest
Posts: n/a
 
      11-02-2005
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>
<xsltherwise>
<xsl:variable name="myVar" select="(insert other Xpath
expression)"/>
</xsltherwise>
</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.


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Put variables into member variables or function variables? tjumail@gmail.com C++ 9 03-23-2008 04:03 PM
XSL Question tp xsl:for-each and xsl:variable schaf@2wire.ch XML 1 05-27-2005 09:25 PM
XSLT question related to <xsl:template> and <xsl:apply-templates> Vijay singh XML 1 11-04-2004 03:42 PM
XSL-1000: (Fatal Error) Error while parsing XSL file (org.apache.xerces.parsers.AbstractSAXParser$AttributesProxy) Kevin Flood Java 0 09-08-2004 02:11 PM
Three question which is not yet answered clearly and correct so far !! challenging question in xsl and also in xsl fo Philip Meyer XML 0 11-30-2003 04:42 PM



Advertisments