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

Re: validation of xslt stylesheets with java

Subject: Re: validation of xslt stylesheets with java
From: Mike Brown <mike@xxxxxxxx>
Date: Sun, 9 Feb 2003 12:33:12 -0700 (MST)
java validate xslt
florian wrote:
> i was wondering if there is a way to validate xslt stylesheets
> somehow? (would be cool if there would be a way with java).

XSLT processors generally do some checks of the stylesheet structure when they
are "compiling" or "preparing" it, and will report errors at that time. JAXP
implicitly acknowledges this step in the creation of a Templates object, but
exactly when and how this occurs is going to be implementation dependent,
generally speaking. Some errors can only be detected at run-time because they
depend on information in an XPath context. Some errors that use XPath
expressions but that don't depend on context are detectable ahead of time, but
not all processors will look for them.

And then http://www.w3.org/TR/REC-xslt/#dtd explains, to some extent, why
validation (in the pure XML 1.0 sense) using DTDs is difficult. The biggest
hurdle, not clearly mentioned in the spec, is that literal result elements and
namespace declarations are allowed to appear in stylesheets, and are more or
less random in what they look like and where they can occur. Since DTDs
require all elements and attributes to be explicitly declared, and either
explicitly referenced or referenced with the all-encompassing "ANY" token, one
would have to heavily customize each DTD for each stylesheet.

Other schema validation mechanisms may be better equipped to deal with the 
"random" nature of stylesheets, but it's unlikely.

Mike

-- 
  Mike J. Brown   |  http://skew.org/~mike/resume/
  Denver, CO, USA |  http://skew.org/xml/

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


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.