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

Subject: RE: [xsl] Schema-aware validation of XHTML result-document
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Fri, 9 Mar 2007 23:51:37 -0000
The other difficulty here is that I think it's increasingly common to mix
XHTML with other XML vocabularies, e.g. SVG or XForms. The fact that the
output method is XHTML doesn't necessarily indicate that everything in the
output will be valid XHTML.

Michael Kay 

> -----Original Message-----
> From: David Carlisle [mailto:davidc@xxxxxxxxx] 
> Sent: 09 March 2007 23:38
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject: Re: [xsl] Schema-aware validation of XHTML result-document
> > 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