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

AW: AW: for-each with included variable

Subject: AW: AW: for-each with included variable
From: "Machelett, Renato (FA.G+M-EP/ETK)" <fa-gm-renato.machelett@xxxxxxxxxxxxxxxxxxx>
Date: Thu, 19 Apr 2001 17:24:00 +0200
renato machelett
Hi David,


Thank you for your comment, but I don't think I'm getting it. The situation
is the following:
I have that variable declared at global scope (at least I assumed I did when
including it), so the content cannot change - at least that's how I
understood the concept of XSL variables. As long as I'm not going out of
scope it will have the value it initially had.

<xsl:include href="IncludeMe.xsl"/>
<!-- $myOPTypeList declared here -->

<xsl:template select="/">
  <xsl:for-each select="Whatever">
    <xsl:for-each select="$myOPTypeList">
      <!-- do some stuff -->
    </xsl:for-each>
  </xsl:for-each>
</xsl:template>

So I think what changes is the nodeset that is retrieved when applying the
content of the variable, not the content of the variable itself. Or is that
wrong?

What I cannot see - due to my poor knowledge of XPath - is the semantic
difference between: 

<xsl:for-each select="(.//*[@OPTypeRef='Type1'])[1] |
(.//*[@OPTypeRef='Type2'])[1] | (.//*[@OPTypeRef='Type3'])[1]">
  <!-- do some stuff -->
</xsl:for-each>

and 

<xsl:variable name="myOPTypeList">XType1,XType2,XType3</xsl:variable>
<!-- global variable again -->

<xsl:for-each select="(.//*[@OPTypeRef[contains($myOPTypeList, .)]])[1]">
  <!-- do some stuff -->
</xsl:for-each>

And there must be a difference because the output is not the same.


Renato


> -----Ursprüngliche Nachricht-----
> Von: davidc@xxxxxxxxx [mailto:davidc@xxxxxxxxx]
> Gesendet am: Donnerstag, 19. April 2001 16:41
> An: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Betreff: Re: AW:  for-each with included variable
> 
> 
> > The variable now holds
> > the entire expression, not just a list of single literals.
> 
> It doesn't hold the expression: it holds the _value_ (ie node set)
> obtained by evaluating that expression at the point you have
> the xsl:variable. this might be a different value than would have been
> obtained by evalutaing the expression at the point you now use
> $myOPTypeList
> 
> David
> 
> _____________________________________________________________________
> This message has been checked for all known viruses by Star 
> Internet delivered
> through the MessageLabs Virus Control Centre. For further 
> information visit
> http://www.star.net.uk/stats.asp
> 
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
> 
> 

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


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-2013 All Rights Reserved.