Help w/Docuverse DOM SDK (Please)
Buzz Andersen
landerse at du.edu
Thu Mar 11 06:41:52 GMT 1999
Whoa...that was a mistranslation from my original code! It was supposed to
read:
x.appendChild(y);
Sorry about the confusion, and thanks much for the advice/code. I've been
generating XML for awhile using proprietary parser APIs, but I'm still
trying to grok the whole SAX/DOM thing.
Buzz Andersen
www.du.edu/~landerse
landerse at du.edu
----------
>From: Don Park <donpark at quake.net>
>To: xml-dev at ic.ac.uk
>Subject: Re: Help w/Docuverse DOM SDK (Please)
>Date: Wed, Mar 10, 1999, 10:58 PM
>
>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)
>
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