W3C home > Mailing lists > Public > xmlschema-dev@w3.org > November 2008

Re: Validating application-specific XHTML

From: Michael Ludwig <mlu@as-guides.com>
Date: Thu, 27 Nov 2008 11:57:19 +0100
Message-ID: <492E7D0F.4060009@as-guides.com>
To: xmlschema-dev@w3.org

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

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

Thanks a lot for your answer.

Michael Ludwig
Received on Thursday, 27 November 2008 10:58:00 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 23:15:48 UTC