xsl:if to separate child elements

Subject: xsl:if to separate child elements
From: pmitra <pmitra@xxxxxxxxxxxxxxxxx>
Date: Mon, 25 Sep 2000 18:35:05 -0700
 I am somehow really stuck trying to separate out different child
elements using <xsl:if>. Please help with the following situation if

Here is an example of the type of xml I am working with - 1 help element
with multiple heltext and helpexample elements:

<category name="science">
This is a descriptive note
This is an example
This is another line of text

I would like to do a for-each to be able to print out all helptext and
helpexample elements in sequence, but I would like to give a different
style to helptext vs helpexample (<pre></pre>). There may be unequal
numbers of these elements.
I am trying:

<xsl:for-each select="help/helptext|help/helpexample">
<xsl:if test="helptext"/>
<xsl:value-of select="."/>

<xsl:if test="position() mod 2=0">
<xsl:value-of select="."/>


the position() mod 2 part works, but I dont have any guarantee that the
particular element will always be in the even position.
I would appreciate any help...

Thank You,
Mila Mitra

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

Current Thread