AW: AW: [xsl] for-each with included variable

Subject: AW: AW: [xsl] 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
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 -->

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

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:variable name="myOPTypeList">XType1,XType2,XType3</xsl:variable>
<!-- global variable again -->

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

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


> -----Ursprüngliche Nachricht-----
> Von: davidc@xxxxxxxxx [mailto:davidc@xxxxxxxxx]
> Gesendet am: Donnerstag, 19. April 2001 16:41
> An: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Betreff: Re: AW: [xsl] 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
>  XSL-List info and archive:

 XSL-List info and archive:

Current Thread