Hi,
I need to parse an XML document which refers a DTD that further refers to other DTDs. The issue is that one of those second step DTDs is ill-formed, but I don't have the rights to change it. How can I force the SAX reader to read the XML, ignoring the DTD issues?
Will the SAXON parser also give issues while transforming this XML? If yes,then how can I avoid that?
Archana
For all your days prepare and treat them ever alike, when you are the anvil - bear, when you are the hammer - strike
William Brogden
Author and all-around good cowpoke
Rancher
My approach would be to get the malformed DTD fixed. Just because you personally don't have the authority to make the change, doesn't mean it can't be done.
And there's no such thing as "the SAXON parser". Saxon just uses whatever XML parser the JVM is configured to use.
Archana Mehta Datta
Greenhorn
Joined: Dec 17, 2010
Posts: 8
posted
0
@William- Yes, I tried that, but despite setting it to false, it kept on validating the DTD.
@Paul- Thanks for the correction Correcting the DTD is just not an option for me, I am way down the hierarchy.
William Brogden
Author and all-around good cowpoke
Rancher
Joined: Mar 22, 2000
Posts: 12269
1
posted
0
How about creating a copy of the XML document with the original DTD reference removed or changed to point to a correct one?
Archana Mehta Datta wrote: Correcting the DTD is just not an option for me, I am way down the hierarchy.
What you have to do is to say "That XML couldn't be parsed because the DTD is incorrect". Keep saying it until somebody figures out that the DTD is incorrect.
Archana Mehta Datta
Greenhorn
Joined: Dec 17, 2010
Posts: 8
posted
0
Thanks Paul, I ended up doing just that and the issue was finally resolved