Altova Mailing List Archives>Archive Index >comp.text.xml Archive Home >Recent entries >Thread Prev - XPath to enforce document order >Thread Next - Re: XPath to enforce document order Re: XPath to enforce document orderTo: NULL Date: 3/17/2009 4:22:00 PM Phlip wrote: > Here's my XPath: > > //form[ > ./descendant::fieldset[ > ./descendant::legend and > ./descendant::li[ > ./descendant::label and > ./descendant::input ] > ] > ] > > Its purpose is unit tests to assert that HTML has certain elements and > attributes (not shown). > > I want it to fail if the <li> appears above the <legend>, in document > order. Or if the <label> appears below the <input>. Any ideas? Maybe //form[ descendant::fieldset[ descendant::legend[ following-sibling::*[ descendant-or-self::li[ descendant::label[ following-sibling::*[ descendant-or-self::input ] ] ] ] ] ] -- Martin Honnen http://JavaScript.FAQTs.com/ | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
