Xerces: Changing dtd declaration

D

D McGilvray

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

D McGilvray

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

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top