RE: Is there a reusable DTD for XSL?

Subject: RE: Is there a reusable DTD for XSL?
From: Mike Brown <mbrown@xxxxxxxxxxxxx>
Date: Wed, 3 Nov 1999 12:54:05 -0700
Tangi Vass wrote:
> The XSL Transformations Working Draft (13/08)

Please note that XSLT is now a Proposed Recommendation as of 08-Oct-1999.
The Working Draft of 13-Aug-1999 is obsolete. is
where to find the latest version.

> gives a fragment of DTD for XSLT. Has someone tried to
> complete it for XML/HTML generation?

In the spec, the text immediately preceding the DTD fragment explains the
reasoning behind its incompleteness, and what kind of combination you could

Take this, for example:

<xsl:template name="head">
      <xsl:call-template name="body">
<xsl:template name="body">
      <xsl:if test="foo">
      <xsl:if test="bar">
         <html>what the?</html>

If you put XHTML element declarations in your DTD, and list all those
elements in the result-elements parameter entity, then the XSLT DTD fragment
should be sufficient to allow <head> or <body> as literal result elements in
the content of <xsl:template>. So, you could verify that there are no result
elements where they shouldn't be with respect to the stylesheet, and that
the result elements are among those that you consider valid.

But there's no way to make use of the XHTML DTD's declarations of
containment relationships between XHTML elements. You could not compare this
stylesheet against a combination of XSLT and XHTML DTDs in order to
determine that this stylesheet produces invalid XHTML and is therefore an
"invalid" stylesheet. If DTDs could deal with namespaces and express
descendant containment rules rather than just parent-child relationships,
you could probably do it.

I think. :)

 XSL-List info and archive:

Current Thread