[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: how to test previous node name

Subject: Re: how to test previous node name
From: xslt.new <xslt.new@xxxxxxxxx>
Date: Sun, 11 Feb 2007 20:00:57 -0600
Re:  how to test previous node name
Hi Andrew:

Thank you for your response. I did try this inside template <item> but
it fails to get me the right result.

This is what I tried:

<xsl:template match="item">
<xsl:if test="preceding::*[1][self::test1]">

<xsl:text>Found test1</xsl:text>
</xsl:if>

</xsl:template>

It is not working.

On 2/11/07, Andrew Welch <andrew.j.welch@xxxxxxxxx> wrote:
On 2/11/07, xslt. new <xslt.new@xxxxxxxxx> wrote:
> Hi all:
>
> I have an XML input:
>
> <test1>
> <item></item>
> <text></text>
> <item></item>
> </test1>
>
> How do I check if the previous node name for <item> is test1 or text?


select="preceding::*[1][self::item1 or self::text]"


cheers
andrew

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2007 All Rights Reserved.