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

RE: Validating XSL expressions and patterns

Subject: RE: Validating XSL expressions and patterns
From: Francois_Deza@xxxxxxxxxx
Date: Wed, 28 Apr 1999 09:54:30 +0100


is it correct that there is no standard way of getting DTD information.

here is the motivation for this question.

Given an input and output DTD, it should be possible to validate the
expressions and patterns which appear in a DTD.
This would make debugging XSL much simpler. A kind of strong type check vs.
runtime check as it is the case today.

The latest XSLT spec mentions that the output XML document can be checked
against the XSL DTD but this does not check the semantic validity of the
XSL document with respect to the input and output DTDs.

Do you think this semantic check can indeed be implemented and if yes do
you know if  there are tools to do such a thing.


---------------------- Forwarded by Francois Deza/AMS/AMSINC on 04/28/99
10:42 AM ---------------------------

Kay Michael <Michael.Kay@xxxxxxx> on 04/26/99 07:47:30 PM

To:   Francois Deza/AMS/AMSINC
Subject:  RE: Validating XSL expressions and patterns

> i just downloaded your great tool SAXON and would like to
> have your opinion
> on compile time validation of XSL stylesheets.

A couple of points:
- firstly, the XSL spec doesn't really allow it. It's perfectly valid to
write a template for XYZ elements even though the DTD doesn't allow XYZ
elements to appear. So either the spec has to change, or the processor
merely be reporting warnings. Still potentially useful though.

- So, yes, I guess an XSL processor that warns you about patterns that will
never match (or never select anything) could be quite a handy tool.

- Even more interesting might be to warn about elements that have no
matching template, elements that are never reached in the processing, or
templates that are never reached in the processing.

- Main difficulty in writing such a tool is that there's still no standard
interface for getting DTD information! It would have to be parser-specific.


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

Current Thread