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: dealing with doctype dtd's


> But I would like to be able to identify the existing doctype
> in the original
> xml, and output it in the new XML without changing it, or
> omit it altogether if it does not exist.

A reasonable request, but I'm afraid it can't be done directly: the DOCTYPE
declaration is not part of the tree model of the document used by XPath and
XSLT.

My suggestion would be to add a SAX2 filter in front of the XSLT processing.
This filter can detect the DOCTYPE declaration and wrap it up as something
else, for example a processing instruction. For symmetry you could then put
another SAX2 filter after the XSLT processing to handle the reverse
conversion.

Mike Kay


 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]