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 12:57:13 GMT
> Its certainly raised an interesting question - should the serialised
> version of the validated result be the per or post validation
> instance?

reading the spec I think Michael's right that it has to be the post
validation instance, however it's not often useful to default these
values on the way out (since if they were not there, the consuming
application would anyway default them back when it (re)validated,

I think you can do

<xsl:result-document href="nodefaults.xml">
 <xsl:variable name="x">
 <xsl:variable name="x-valid">
 <xsl:copy-of select="$x" validation="strict"/>
 <xsl:if test="$x-valid">
  <xsl:sequence select="$x"/>

which builds an unvalidated tree, then builds a validated tree (which
will generate the necessary error and debugging info if the result is
not valid) then outputs the original tree.

Or of course more simply just use a locally modified schema (I've often
removed these defaults from html dtd over the years, and would no doubt
remove them from the xhtml schema if I found myself using that)


Current Thread