This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Is there an elegant way to copy a DOCTYPE declaration from one doc to another?


Joe Ward wrote:
> So far, the only way I've found to keep the doctype declaration intact after
> a "pass-through" transformation is to hide a copy of the declaration in a
> comment via a pre-processor and then extract it.
> 
> Is there a more elegant way? (Frankly, if I have to write a preprocess
> script, I might as well skip XSLT altogether.)
> 
> Is this a major flaw in XSLT?

The doctype declaration is not acknowledged in the XPath/XSLT data model,
presumably because to support this declaration you need to support the
kind of stuff you're likely to find in it -- the internal subset of the
DTD -- and the non-XML syntax of DTDs poses formidable challenges.

"support for DTDs in the data model" is listed in Appendix G of the XSLT
1.0 Recommendation as a feature under consideration for future versions.

I would guess it's not a high priority, because the <!DOCTYPE> contains
document metadata for an XML parser to use; it doesn't convey crucial
information that would affect how an XSLT processor should go about
constructing the source tree.

   - Mike
____________________________________________________________________
Mike J. Brown, software engineer at         My XML/XSL resources:
webb.net in Denver, Colorado, USA           http://www.skew.org/xml/


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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]