Help w/Docuverse DOM SDK (Please)

Don Park donpark at quake.net
Thu Mar 11 05:59:23 GMT 1999


Buzz,

>DOM dom = new com.docuverse.dom.DOM();
>dom.setProperty("sax.driver", "com.ibm.xml.parser.SAXDriver");
>Document x = dom.createDocument("e1");
>Element y = x.createElement("e2");
>y.appendChild(root);
>
>I would think this would generate:
>
><e1>
>   <e2></e2>
></e1>

I don't know what y.appendChild(root) is supposed to be but you have to
insert your "e2" element into your document.

// creates a document with "e1" as document element
Document doc = dom.createDocument("e1");

// make sure document root exists
Node e1 = doc.getDocumentElement();
if (e1 == null)
    e1 = doc.appendChild(doc.createElement("e1"));

// create and insert e2 into e1
e1.appendChild(doc.createElement("e2"));

at this point, you will have:

<e1><e2/></e1>

Best,

Don Park
Docuverse



xml-dev: A list for W3C XML Developers. To post, mailto:xml-dev at ic.ac.uk
Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/ and on CD-ROM/ISBN 981-02-3594-1
To (un)subscribe, mailto:majordomo at ic.ac.uk the following message;
(un)subscribe xml-dev
To subscribe to the digests, mailto:majordomo at ic.ac.uk the following message;
subscribe xml-dev-digest
List coordinator, Henry Rzepa (mailto:rzepa at ic.ac.uk)




More information about the Xml-dev mailing list