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: Copy DocType


Kevin_Gutch@mapinfo.com wrote:
> Is it possible to include a DocType Declaration in an XSLT pass thru?

You don't have access to it because it is not in the XPath/XSLT tree
model, which doesn't have anything in it that wouldn't be reported by
a SAX parser (document type declaration being one of those things).

XSLT does have a provision for emitting a new declaration, though its
functionality is limited. You cannot specify an internal subset, and
you must hard-code the string used for the SYSTEM or PUBLIC identifier.

Also, you don't put it in the result tree; you just tell the processor
to add it to the output when it serializes the result tree in XML
syntax. See section 16.1 of the XSLT 1.0 rec.

<xsl:output method="xml" doctype-system="http://external/dtd/location"; />

   - Mike
_____________________________________________________________________________
mike j. brown, software engineer at  |  xml/xslt: http://skew.org/xml/
webb.net in denver, colorado, USA    |  personal: http://hyperreal.org/~mike/

 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]