|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: Is there a reusable DTD for XSL?
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. http://www.w3.org/TR/xslt 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
do.
Take this, for example:
<xsl:template name="head">
<head>
<xsl:call-template name="body">
</head>
</xsl:template>
<xsl:template name="body">
<body>
<xsl:if test="foo">
<p>hi</p>
</xsl:if>
<xsl:if test="bar">
<html>what the?</html>
</xsl:if>
</body>
</xsl:template>
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: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








