[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Schema-aware validation of XHTML result-document

Subject: Re: Schema-aware validation of XHTML result-document
From: "Jesper Tverskov" <jesper@xxxxxxxxxxx>
Date: Fri, 9 Mar 2007 14:13:37 +0100
Re:  Schema-aware validation of XHTML result-document
David is proposing that we use two result-document elements to
generate both a file for validation we could call href="junk.xhtml"
and the real file, href="nice.xhtml", that is not validated. If no
errors are reported and the transformation is not stopped, we just use
our real file.

Thanks for that workaround.
But are we serious! Is this the way we are supposed to work in XSLT?

Cheers,
Jesper



On 3/9/07, David Carlisle <davidc@xxxxxxxxx> wrote:

> 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:apply-templates/>
 </xsl:variable>
 <xsl:variable name="x-valid">
 <xsl:copy-of select="$x" validation="strict"/>
 </xsl:variable>
 <xsl:if test="$x-valid">
 <xsl:sequence select="$x"/>
 </xsl:if>
 </xsl:result-document>

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)

David




--
Jesper Tverskov

www.xmlkurser.dk
www.xmlplease.com

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.