[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Quick Xpath
Hi Garland, > Return all the "b" nodes that are inmediately preceded by an "a" > element (the bold nodes). Use: /foo/b[preceding-sibling::*[1][self::a]] preceding-sibling::*[1] gets you the immediately preceding element; the [self::a] predicate tests whether the element that you select is an 'a' element or not. It's better doing it this way than using local-name() because it deals properly with namespaces (i.e. it looks for 'a' elements in no namespace rather than all elements that are called 'a' no matter what namespace they're in). Cheers, Jeni --- Jeni Tennison http://www.jenitennison.com/
|
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
|