[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

[xsl] Re: validating stylesheet

Subject: [xsl] Re: validating stylesheet
From: "lars" <lars@xxxxxxxxxx>
Date: Fri, 21 Jan 2005 13:23:51 -0600

Hi all,

Apologies for replying to a very old email, but it addresses an issue I wanted
to ask about.

    * To: "'Cirip Tomas'" <tomas.cirip@xxxx
      <mailto:tomas.cirip@xxxx>>,"'XML-Dev mailing list \(E-mail\)'"
      <xml-dev@xxxx <mailto:xml-dev@xxxx>>
    * Subject: RE: [xml-dev] Validating stylesheet
    * From: "Michael Kay" <michael.h.kay@xxxx <mailto:michael.h.kay@xxxx>>
    * Date: Fri, 24 Jan 2003 09:13:00 -0000
    * Importance: Normal
    * In-reply-to: <F0FD42ECBD1123429E9E4E21233151D855393C@xxxx
    * Reply-to: <michael.h.kay@xxxx <mailto:michael.h.kay@xxxx>>

> > I need to validate XSLT <http://www.stylusstudio.com/xslt.html> document.
How can I do that using either DTD or XML Schema?
> Why would you want to validate an XSLT document using a DTD or XML Schema,
when you can do the job much more thoroughly with an XSLT processor?
> Michael Kay

An XSLT processor doesn't always report errors. For example, we are developing
Cocoon applications, which use Xalan by default as the XSLT processor.
Sometimes, when there's a structural mistake in a stylesheet (e.g. an
<xsl:choose> with a literal result element child), we get either no error
message from Xalan, or an error message that gives no hint as to what the
mistake was.
When we substitute Saxon for Xalan, we generally get much better error
messages. (However Cocoon has certain incompatibilities with Saxon, so we
can't just use it by default.)
So we would like to validate our XSLT documents separately from using them.
It may well be that we can do it with an XSLT processor, e.g. with Saxon, but
I've been searching in vain for documentation on how to do so -- e.g.
command-line arguments. Maybe Saxon just always does it and you can't turn it off.
If so, that's the answer I'm looking for.
I would also like to know if there is a command-line switch for Xalan or
xsltproc to do this. (If they do so without switches, I would like to know
that too.)

Please CC me with any answers, as I don't always scan this list.


Current Thread