Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: XPath to enforce document order

From: Phlip <phlip2005@-----.--->
To: 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


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent