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/17/2009 5:52:00 AM Philippe Poulard wrote: > Phlip a écrit : >> XMLers: >> >> 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? > This is a job for WUnit : Please don't make my question look answered in the forum. I'm not the user-programmer testing a page, I'm the vendor-programmer writing an assertion, so I actually need an answer. And Ruby on Rails hardly needs a new system to mock the web server and browser. My assertion does not require the incredible verbosity of XSL. Good luck getting XSL, or Java, to look like this: assert_xhtml do h2 'ACH Sales' select! :size => SaleController::LIST_SIZE do option names[1] option names[0] end end We just write the names and values of our target HTML elements into the block. -- Phlip | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
