This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: xsl:if/xsl:when test
- To: xsl-list at lists dot mulberrytech dot com
- Subject: Re: [xsl] xsl:if/xsl:when test
- From: "Maulik Modi" <mxmodi at duke-energy dot com>
- Date: Thu, 22 Feb 2001 13:03:55 -0600
- Reply-To: xsl-list at lists dot mulberrytech dot com
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.
Maulik.
Philip.Strube@ofd.mf.lsa-ne
t.de (Philip Strube) To: xsl-list@lists.mulberrytech.com
Sent by: cc:
owner-xsl-list@lists.mulber Subject: Re: [xsl] xsl:if/xsl:when test
rytech.com
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
the
> first child, and if both text are valid, it processes each <URL> under
it,
> 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: http://www.mulberrytech.com/xsl/xsl-list
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list