Re: Is there an elegant way to copy a DOCTYPE declaration fr
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
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