Hi to All Groups Google

Discussion in 'XML' started by sekhar145, Mar 28, 2008.

  1. sekhar145

    sekhar145 Guest

    After loading xml from file, i want to modify DOCTYPE but it is read
    only am using org.w3c.dom packages.

    can any ONE suggest or send some examples how to modify DOCTYPE IN XML
    USING JAVA CODE.
     
    sekhar145, Mar 28, 2008
    #1
    1. Advertising

  2. sekhar145

    sekhar145 Guest

    On Mar 28, 11:15 am, sekhar145 <> wrote:
    > After loading xml from file, i want to modify DOCTYPE but it is read
    > only am using org.w3c.dom packages.
    > exceptions getting: HIERARCHY_REQUEST_ERR: An attempt was made to insert a node where it is not permitted.
    > can any ONE suggest or send some examples how to modify DOCTYPE IN XML
    > USING JAVA CODE.
     
    sekhar145, Mar 28, 2008
    #2
    1. Advertising

  3. sekhar145

    Peter Flynn Guest

    sekhar145 wrote:
    > After loading xml from file, i want to modify DOCTYPE but it is read
    > only


    Make it read/write and do the modification *before* you open the document.

    > am using org.w3c.dom packages.
    >
    > can any ONE suggest or send some examples how to modify DOCTYPE IN XML
    > USING JAVA CODE.


    I don't think you can do this. By the time the document is open, the
    DOCTYPE Declaration has already been used and discarded.

    ///Peter
    --
    XML FAQ: http://xml.silmaril.ie/
     
    Peter Flynn, Mar 28, 2008
    #3
  4. sekhar145

    none Guest

    Check whether your parser allows plugging in an entity resolver, which
    could intercept the request for the external part of the DTD and
    redirect it to a private copy.

    Alternatively, plug in a text filter before the XML parser which
    understands just enough XML to find and alter the DTD.

    Alternatively: If this isn't the right DTD, why is your document
    pointing to it in the first place? Fix your doc...
     
    none, Mar 30, 2008
    #4
    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. Petra Hübner
    Replies:
    0
    Views:
    471
    Petra Hübner
    Feb 16, 2004
  2. anonymous
    Replies:
    1
    Views:
    4,662
    Francisco Padron
    May 8, 2005
  3. Andrew Thompson

    FAQ - references to Google/Google Groups

    Andrew Thompson, Jun 20, 2005, in forum: Java
    Replies:
    0
    Views:
    700
    Andrew Thompson
    Jun 20, 2005
  4. JD
    Replies:
    5
    Views:
    1,795
    Dan Abrey
    Aug 12, 2004
  5. Replies:
    3
    Views:
    383
    Peter Hansen
    Jun 10, 2005
Loading...

Share This Page