Parsing DTD from XML in Java

A

Amit Sharma

Hi

I have an XML file with DTD in the same file. The problem I am faced
with is that I need to modify the XML file programatically (Java XML
API) and write it back to the same file - but in the process of doing
so, I am losing the DTD part entirely.

Could someone please help me

1) Not lose the DTD
2) Programatically read the DTD from this XML file and manipulate it
if necessary.

The LexicalHandler interface does define startDTD() and endDTD()
events but I am not sure if it can be used to read the entire DTD.

Please help.

Thanks
Amit
 
M

Manish Hatwalne

Isn't it conveient for you to get this DTD outside your XML file?
I hope somebody has more useful answer though...

- Manish
 

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,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top