At 2003-09-02 16:55 +0530, Sanghamitra Das wrote:
When we write an xsl, we get some error if the XSL is not proper. How the
validation actually happens?
The XSLT processor performs validation on the input XSLT stylesheet.
Where is the DTD for XSL?
There is no DTD for XSL.
Can any one tell me the logic behind the process.
DTD syntax is not expressive enough to describe all the required
constraints for an XSLT stylesheet. The XSLT processor has to work on the
entire document anyway in order to complete its task, so it is in a
position to do all of the required validation algorithmically instead of
relying on a declarative expression in an external grammar. Everyone's
result vocabulary is potentially unique and there is no way a standards
committee could constrain everyone's possible outputs.
http://www.w3.org/TR/xslt#dtd" This link has the DTD.
This is not true, the link has a non-normative DTD fragment used to help a
reader understand the gist of the requirements, but the collection of
parameter entities supplied must be tailored to your result vocabulary in
order for it to be utilized as a standalone grammatical expression of an
instance of a stylesheet.
Even then, it is impossible to express all of the constraints using DTD
semantics. Take, for example, <xsl:template>. This element requires
either the name= attribute, the match= attribute, or both of these
attributes, but not neither of these attributes. This cannot possibly be
expressed in the DTD semantics for a document model.
But in the namespace we use this <xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
Namespaces have *nothing* to do with document models and are *only* used to
distinguish constructs from the XSLT vocabulary from constructs of other
vocabularies you utilize in your stylesheet. There is no other purpose for
namespaces than vocabulary distinction in XML instances.
The question remains, even if it *were* possible to express all of the
constraints in DTD semantics (which isn't possible), why is an external
standalone grammatical expression of the XSLT document model important to
you when the XSLT processor is already fulfilling the constraint validation
checking on your stylesheets?
I hope this helps.
.......................... Ken
--
Next public European delivery: 3-day XSLT/2-day XSL-FO 2003-09-22
Instructor-led on-site corporate, government & user group training
for XSLT and XSL-FO world-wide: please contact us for the details
G. Ken Holman mailto:gkholman@xxxxxxxxxxxxxxxxxxxx
Crane Softwrights Ltd. http://www.CraneSoftwrights.com/s/
Box 266, Kars, Ontario CANADA K0A-2E0 +1(613)489-0999 (F:-0995)
ISBN 0-13-065196-6 Definitive XSLT and XPath
ISBN 0-13-140374-5 Definitive XSL-FO
ISBN 1-894049-08-X Practical Transformation Using XSLT and XPath
ISBN 1-894049-11-X Practical Formatting Using XSL-FO
Member of the XML Guild of Practitioners: http://XMLGuild.info
Male Breast Cancer Awareness http://www.CraneSoftwrights.com/s/bc
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list