[thelist] [XSL] Testing the next element

Howard Cheng howcheng at ix.netcom.com
Wed Oct 16 17:43:00 CDT 2002

Hi all,

I've got a conundrum here. I have an XML document like such:

         <category id="1">text</category>
         <category id="2">text</category>
         <category id="3" selected="true">text</category>
         <category id="4">text</category>

In my XSL I want to be able to test the attribute the following element,
like such:

<xsl:template match="category">
         <xsl:value-of select="text()"/>
         <xsl:if test="[next element is selected]">
                 <img src="..."/>

But I can't figure out the XPath. I've tried:


But neither of them work. Any ideas?

Thanks in advance.

Howard Cheng
http://www.howcheng.com/ <-- NEW!
howcheng at ix dot netcom dot com
AIM: bennyphoebe
ICQ: 47319315

More information about the thelist mailing list