xml-general mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Hai-Bang Pham <Hai-Bang.P...@marshmc.com>
Subject [question] Why is the doctype not set?
Date Mon, 24 Jan 2000 17:55:22 GMT
Hello,

I'm currently working with Xerces-J v1.0.1 and I can't seem to set a 
doctype in a new document i.e.

...
//new DocumentTypeImpl(ownerDoc, name, publicID, systemId);
DocumentType docType = new DocumentTypeImpl( null, "TAG", null, 
"http://server/dtd/TAG.dtd" );
Document doc = new DocumentImpl( docType );
...

Inspecting the document type in doc gives null.

I've also tried doing it with the DOM level 2 API:

...
DOMImplementation DOMImpl = DOMImplementationImpl.
getDOMImplementation();
DocumentType docType = 
((DOMImplementationImpl)DOMImpl).createDocumentType("TAG", null, 
"http://server/dtd/TAG.dtd" );
Document doc = ((DOMImplementationImpl)DOMImpl).createDocument(null, 
"TAG", docType);
...

But the document type in doc is still null.

What I want to do is create a new document in memory that has the 
following structure:

<?xml version="1.0" standalone="no"?>
<!DOCTYPE TAG SYSTEM "http://server/dtd/TAG.dtd">
...

Any help would be appreciated.  Thanks in advance.

-Hai

Mime
View raw message