[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: Using the 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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|