Hi to All Groups Google

S

sekhar145

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.
 
S

sekhar145

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.
 
P

Peter Flynn

sekhar145 said:
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
 
N

none

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...
 

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
473,769
Messages
2,569,578
Members
45,052
Latest member
LucyCarper

Latest Threads

Top