Altova Mailing List Archives>Archive Index >comp.text.xml Archive Home >Recent entries >Thread Prev - Re: XPath to enforce document order >Thread Next - Re: XPath to enforce document order Re: XPath to enforce document orderTo: NULL Date: 3/18/2009 1:05:00 PM Phlip wrote: > path = "//fieldset[ > descendant::legend[ > following-sibling::*[ > descendant-or-self::li[ > descendant::label[ > following-sibling::*[ > descendant-or-self::br[ > following-sibling::*[ > descendant-or-self::input ] ] ] ] ] ] ] ]" > > Problem: Here's the sample input: > > <fieldset> > <legend>Personal Information</legend> > <ol> > <li id="control_user_first_name"> > <label for="user_first_name">First name</label> > <input type="text" name="user[first_name]" id="user_first_name" /> > <br/> > </li> > </ol> > </fieldset> > > Notice the <br/> is below the <input>, not above it. > > Ironically, I can move other elements around and successfully fail the > query. > > Bug in libxml2? Pilot error? Gap in the language specification? When I evaluate your XPath expression against the sample XML you posted then it returns an empty node-set. Tested with the XPath tool in jEdit's XML and XSLT/XPath plugin which is based on Xalan Java. I don't see why it should find a node as the 'br' element has no following-sibling::* element at all. Thus if libxml2 with that expression and XML input returns a non-empty node-set then I think it has a bug. -- Martin Honnen http://JavaScript.FAQTs.com/ | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
