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

RE: XML 2 XML using XSL,DTD XALAN - JAVA

Subject: RE: XML 2 XML using XSL,DTD XALAN - JAVA
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Wed, 24 Nov 2004 23:40:33 -0000
xalan validator
> The only way to validade the result DOM tree is to parse it again?
> The XSL that I'm using has the output property below:
> <xsl:output method="xml" indent="no" encoding="ISO-8859-1" 
> doctype-system="../DTD/MyDTD.dtd"/>
> 
> Even with this, the result DOM tree doesn't have a DocType 
> with it. Does anyone knows why?

Because xsl:output only affects the serializer, and when you send your
output to a DOM, you are not serializing it.

JAXP 1.3 provides a SAX-based validation API. This provides a validator in
the form of a ContentHandler, and since JAXP allows you to send the results
of a transformation to a ContentHandler, you should be able to pipe
transformation results straight into a validator.

For a more closely integrated solution (but only with XML Schema) XSLT 2.0
allows you to request validation of a result document directly. I personally
find this the most useful aspect of XSLT/Schema integration in XSLT 2.0 -
until you get used to it, it comes as quite a surprise to see error messages
pointing straight to the line in your stylesheet that generates the
incorrect output.

Michael Kay
http://www.saxonica.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.