Xerces: Changing dtd declaration

D McGilvray

Usenet Archive
Joined
Aug 25, 2006
Messages
7
Reaction score
0
Hi, I'm stuck on a really simple problem using xerces DOM.

I am parsing an xml file and adding information which is described in an extended DTD. Therefore, I need to change the DTD declaration.

The DOMDocument::createDocumentType(...) method seems to have no effect on the document which already has a dtd declaration. The only way I can see to set the DTD declaration is when you create a new document with
DOMImplementation::createDocument

But when I try to clone the contents of the original document and append them to the new doument xerces throws a WRONG_DOCUMENT_ERROR in my face.

Is there some dark magic I need to perform? Or am I having a blonde day and I can't see the woods for my fringe?

Thanks for your time,
Dougie
 

D McGilvray

Usenet Archive
Joined
Aug 25, 2006
Messages
7
Reaction score
0
Just found it :)
DOMDocument::importNode imports from another document.

SOmetimes you just need to explain your problems to someone else and they all become clear :).

Cheers anyway.
DOug
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
548,049
Messages
3,104,244
Members
248,133
Latest member
DujonT

Latest Threads

Top