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

RE: Exclude elements in transformation

Subject: RE: Exclude elements in transformation
From: "Andrew Welch" <ajwelch@xxxxxxxxxxxxxxx>
Date: Thu, 16 Sep 2004 10:40:59 +0100
xpath exclude element
> I want to exclude each element that is preceeded by a
> specific tag, call it A.
>
> So i have XML like:
>
> <A>blah</A>
> <B>blub</B>
>
> I have a XSLT template for A and that includes the following
> element (B here). So now i need a template for each element
> that is preceeded by A and does nothing, but i don't know the
> Xpath expression or it.

This will do what you ask:

<xsl:template match="*[preceding-sibling::A]"/>

But I suspect there might be a better solution - I think it's preferable
to not select the nodes to process in the first place, rather than
select everything and use a no-op template to suppress the things you
don't want.  You would need to give a little more information for that
kind of answer.

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-2013 All Rights Reserved.