Re: [xsl] Schema-aware validation of XHTML result-document

Subject: Re: [xsl] Schema-aware validation of XHTML result-document
From: David Carlisle <davidc@xxxxxxxxx>
Date: Fri, 9 Mar 2007 23:38:04 GMT
> The schema is stricter than the DTD, several things are allowed in the
> DTD but not in the schema. But not the other way except for those
> namespace related attributes.

this is building in a lot of knowledge about the relative features of
the dtd and schema, which is why I commented there is essentially no way
you could expect this from the xml output method (which uses _no_
special knowledge about xhtml at all) the xhtml output method being
specifically designed to make xhtml more palatable to existing html
systems (that is IE, in practice) could perhaps have some warnings about
this (but again the article is misleading in implying that it's up to
the _system_ to make this choice, when the behaviour is mandated by the
specification) 

> For that reason it ought to be possible and easy for the XSLT
> stylesheet to warn you. Not that validation against the schema has
> failed but that the output will not be valid validated against the DTD
> specified in the result-document element in the stylesheet. Yes it is
> a little confusing.

given that XSLT _never_ validates against the result DTD, this would
just be a warning issued on every transformation on every document,
is that really what you are suggesting? 

apart from  extra namespace declarations, the element names could be
prefixed, <h:html.... or the public or system identifier could be
wrong, all of which only affect DTD validity not schema validity
(having the wrong dtd secified could affect schema validity or even
well-formedness of the output _file_ but it won't affect the
schema-validity of the in-memory result document which has no record of
the !DOCTYPE as it has no XDM representation, it's just added as part of
the serialisation, after the schema validation.

David

Current Thread