Re: [xsl] xsl:if/xsl:when test

Subject: Re: [xsl] xsl:if/xsl:when test
From: "Maulik Modi" <mxmodi@xxxxxxxxxxxxxxx>
Date: Thu, 22 Feb 2001 13:03:55 -0600
Hi Philip:

I see what you are saying...however the test I need to do is to "compare"
two values from two separate documents. Also, I need to test multiple pairs
and if all the tests are true, I return the list of <URL>'s from the
original context node.  For this I need to change the context node back and
forth between two documents and "store" the test result until I am done
parsing the entire set of <NODE>.

Either I am trying to achieve too much in form of genericness...or my XML
design is flawed. I need some help with that.


           (Philip Strube)               To:     xsl-list@xxxxxxxxxxxxxxxxxxxxxx                                   
                    Sent by:                           cc:                                                                       
                    owner-xsl-list@xxxxxxxxxxxx        Subject:     Re: [xsl] xsl:if/xsl:when test                               
                    02/22/2001 02:08 AM                                                                                          
                    Please respond to xsl-list                                                                                   

Hi Maulik,

> WHAT I have working:
> In the following XML, I have two <Node_path> and <Node_value> pairs in
> first child, and if both text are valid, it processes each <URL> under
> meaning six times!
> Snippet XSL code:
>    <xsl:for-each select="$tempdoc//NODE">

do the test
if test is ok:
>          <xsl:for-each select="$tempdoc//URL">
>           <url><xsl:value-of select="." /></url>
>          </xsl:for-each>
>          </xsl:if>
>        </xsl:for-each>
You've got two nodes and three URLs. You call the inner xsl:for-each two
times and get three URLs => you get six results.

You probably want something like:
for-each NODE
  do the test
if all tests are ok
  for-each url
    do what you like

Gruß, Philip

 XSL-List info and archive:

 XSL-List info and archive:

Current Thread