You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by bu...@apache.org on 2001/03/26 22:31:22 UTC
[Bug 1121] New - DOCTYPE not written to serialized output for an in-memory DOM
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=1121
*** shadow/1121 Mon Mar 26 12:31:21 2001
--- shadow/1121.tmp.15023 Mon Mar 26 12:31:21 2001
***************
*** 0 ****
--- 1,49 ----
+ +============================================================================+
+ | DOCTYPE not written to serialized output for an in-memory DOM |
+ +----------------------------------------------------------------------------+
+ | Bug #: 1121 Product: XalanJ2 |
+ | Status: NEW Version: 2.0.1 |
+ | Resolution: Platform: PC |
+ | Severity: Critical OS/Version: |
+ | Priority: High Component: org.apache.xalan.serial |
+ +----------------------------------------------------------------------------+
+ | Assigned To: xalan-dev@xml.apache.org |
+ | Reported By: Rick.Bullotta@lighthammer.com |
+ | CC list: Cc: |
+ +----------------------------------------------------------------------------+
+ | URL: |
+ +============================================================================+
+ | DESCRIPTION |
+ Could be a usage issue or "undocumented feature" we're missing...basically
+ creating an in-memory DOM, then trying to serialize it using the Xalan
+ Serializer (note: the Xerces serializer works fine). First glance at the
+ Xalan source didn't yield any immediate indications as to why it wouldn't
+ be working.
+
+ ==================
+
+ Here's a code snippet to reproduce:
+
+ DocumentImpl doc = new DocumentImpl();
+
+ // Add DTD information
+
+ String strDocType = "MyDocType";
+
+ DocumentType dtd = doc.createDocumentType(strDocType,null,LOCALHOST_PATH +
+ Constants.DTD_STORAGE_SUBDIRECTORY + strDocType +
+ Constants.DTD_FILE_EXTENSION);
+
+ doc = new DocumentImpl(dtd);
+
+ // Create the root element and add it to the tree
+
+ Element root = doc.createElement(strDocType);
+ doc.appendChild(root);
+
+
+ Serializer serializer =
+ SerializerFactory.getSerializer(OutputProperties.getDefaultMethodProperties
+ ("xml"));
+ serializer.setWriter(System.out);
+ serializer.asDOMSerializer().serialize(doc);