Xerces: Changing dtd declaration

Discussion in 'XML' started by D McGilvray, Aug 25, 2006.

  1. D McGilvray

    D McGilvray Guest

    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, Aug 25, 2006
    #1
    1. Advertising

  2. D McGilvray

    D McGilvray Guest

    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
    D McGilvray, Aug 25, 2006
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. John Smith

    Xerces and DTD

    John Smith, Sep 29, 2005, in forum: Java
    Replies:
    0
    Views:
    359
    John Smith
    Sep 29, 2005
  2. Simon
    Replies:
    0
    Views:
    1,328
    Simon
    Jul 3, 2003
  3. Daniel Ng
    Replies:
    0
    Views:
    1,392
    Daniel Ng
    Jul 8, 2003
  4. bugbear
    Replies:
    0
    Views:
    1,000
    bugbear
    Aug 28, 2003
  5. cvissy
    Replies:
    0
    Views:
    601
    cvissy
    Nov 16, 2004
Loading...

Share This Page