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

RE: Using the not() function

Subject: RE: Using the not() function
From: Mike Brown <mbrown@xxxxxxxxxxxxx>
Date: Tue, 18 Jan 2000 19:38:49 -0700
xml not function
> So am I missing something here?  I get errors in processing 
> when I have:
> 
> <xsl:template match="my:root">
>   <xsl:apply-templates select="not(self::my:element)" />
> </xsl:template>
> 
> on the following document:
> 
> <my:root xmlns:my="http://myurl.com">
>   <my:element />
>   <my:otherElement />
> </my:root>

I assume you declared xmlns:my="http://myurl.com" in the stylesheet, since
you're selecting 'element' elements associated with the namespace that 'my'
is a prefix for.

"not(self::my:element)" by itself is incorrect because you haven't selected
nodes along an axis first. Many nodes on many axes (for example, my:root)
could be "not elements named 'element' in the 'http://myurl.com' namespace".

Try "node()[not(self::my:element)]" or "*[not(self::my:element)]" which will
first select nodes or elements along the child axis, then will narrow down
that set to only those that meet the additional criteria.


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


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.