At 3:39 PM +1100 3/3/03, Robert Leftwich wrote:
I am having a problem getting a DOCTYPE specified using <xsl:output doctype-system="file.dtd"/> actually into a DOMResult.
If I use a StreamResult (to System.out) the DOCTYPE is there but if I use a DOMResult and then check with getDocType() it is not. The code is as follows:



Standard DOM Level 2 methods make the DOCTYPE read-only. That is, you can't add a DocumentType node to a Document object. The StreamResult gets around this by writing out the expected characters at the relevant position in the stream. However, it's never part of the object model. DOMResult has nothing but the object model, so it's really not possible to get a DocumentType into it.


It would be possible to fix this using either DOM Level 3 methods (since DocumentType is no longer read-only in DOM3) or Xerces-speciifc implementation methods. However, both would tie Xalan pretty tightly to just the Xerces DOM, something I suspect the developers would prefer not to do.
--


+-----------------------+------------------------+-------------------+
| Elliotte Rusty Harold | [EMAIL PROTECTED] | Writer/Programmer |
+-----------------------+------------------------+-------------------+
|           Processing XML with Java (Addison-Wesley, 2002)          |
|              http://www.cafeconleche.org/books/xmljava             |
| http://www.amazon.com/exec/obidos/ISBN%3D0201771861/cafeaulaitA  |
+----------------------------------+---------------------------------+
|  Read Cafe au Lait for Java News:  http://www.cafeaulait.org/      |
|  Read Cafe con Leche for XML News: http://www.cafeconleche.org/    |
+----------------------------------+---------------------------------+

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to