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

schema aware - validating result using xhtml schema

Subject: schema aware - validating result using xhtml schema
From: andrew welch <andrew.j.welch@xxxxxxxxx>
Date: Tue, 22 Nov 2005 14:15:45 +0000
xhtml schema
Hi,

Can someone provide an example of how to validate the result tree (as
it's being created) using the XHTML strict schema?

<xsl:stylesheet
        version="2.0"
        xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
        xmlns:xhtml="http://www.w3.org/1999/xhtml">

<xsl:output method="xhtml"/>

<xsl:import-schema namespace="http://www.w3.org/1999/xhtml"
schema-location="xhtml1-strict.dtd"/>

<xsl:template match="/">
	<xsl:result-document
	     doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"
	     doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN"
	     validation="strict">
		<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
			<body>
				<div>test</div>
				<fake>failing element</fake>
				<div>test2</div>
			</body>
		</html>
	</xsl:result-document>
</xsl:template>

</xsl:stylesheet>

As usual, the spec is tough going and I can't find any examples (I
would have thought that generating XHTML using XSLT 2.0 and the strict
schema would be the most popular use for 2.0...)

Anyway, the above example is what I've cobbled together based on
reading section 19 of the spec a few times, although I'm guessing
import-schema is needed even though all the information is contained
in xsl:result-document.

Currently I get the error:

Error on line 26 column 3 of file:/c:/tmp/xhtml1-strict.dtd:
  SXXP0003: Error reported by XML parser: The markup in the document preceding
t
he root
  element must be well-formed.
Error at xsl:import-schema on line 8 of file:/c:/tmp/test.xsl:
  Failed to parse schema document
Failed to compile stylesheet. 1 error detected.

Whichs seems to say there is a problem parsing the schema... I'm sure
this should be easier than it is - it's all up-hill at the moment.

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.