Skip to main content

Java 1.6.0-rc b104 XML parsing problem

No replies
bansha
Offline
Joined: 2006-05-08

Hello,
I upgraded my system to use 1.6.0 rc-b104. I am parsing an XML file using SAX. I have entities in my XML that are relative to where the XML file lives.
I have extended the org.xml.sax.helpers.DefaultHandler so that I override unparsedEntityDecl(String name, String publicId, String systemId, String notationName)
I am using the SAXParser that the J2SDK has 'embedded' as part of JAXP.
In version 1.5.0_09 of Java, when unparsedEntityDecl is called, the systemId passed into this method for the entity is the file URI for the absolute path to this entity based on the BASE URI of the mission.xml.
(e.g. file:/C:/Documents%20and%20Settings/lodonnell/Desktop/Big%20Mission/sketches/User,%20Dummy-070705%201055-2)
)
In version 1.6.0 rc b104 of Java, the system Id passed into this method of rht entity is the relative URI as foun d in the entity)
(e.g. sketches\User, Dummy-070705 1055-2)
which causes parsing to fail and the entity to not be found. 1. because there is a backslash in the path, and 2. because there are spaces in the path. Why doesn't this version of the Parser make this relative URI absolute like the previous version did?