Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: Validating application-specific XHTML

From: Michael Ludwig <mlu@---------.--->
To: xmlschema-dev@--.---
Date: 11/27/2008 10:59:00 AM
Michael Kay schrieb:
>
> Sounds like you need to use schema-aware XSLT. If you use that to the
> the full, it can spot many cases of generating invalid output at
> stylesheet compile time, and the rest at run-time.

The application generating HTML currently is on PHP and XSLT 1.0. The
HTTP test tool I have in mind could make use of XSLT 2.0, that's true.
Including SA.

I'll keep on reading your book to get more familiar with 2.0, which I am
not yet.

> But it's not entirely clear to me from your post what constraints you
> are trying to validate against and whether they can all be expressed
> in a schema.

Things like this:

* body/div[@id = 'nav'] is present
* body/div[@id = 'content']/div[@class = 'bclg'] is present
* count( div[@class = 'bclg']/div[@class = 'item'] ) > 0
* div[@class = 'item']/h1 is present
* string-length(h1) > 0

Nothing too complicated, I think. (Maybe a lot of details, though.)

Using XML Schema for checking my XHTML came to my mind when reading the
documentation for HttpUnit (the Java library I mentioned that can be
used to write tests for web applications) and seeing the DOM-based
checks they suggest you do.

HttpUnit Cookbook
http://httpunit.sourceforge.net/doc/cookbook.html

But maybe XSL and XPath (especially 2.0) are better suited for this
task.

Thanks a lot for your answer.

Michael Ludwig



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