Tracker: Bugs

5 Parsing causes DocumentException if # exists in file name - ID: 681658
Last Update: Comment added ( polx )

When parsing using SAXReader.read(File)
a DocumentException is thrown if the # sign exists in
the file name. This is not the case when parsing via
SAXReader.read(InputSource)

this will cause a DocumentException:

new SAXReader().read(new File("#.xml"));

this will not:

new SAXReader().read(new InputSource(new FileReader
(new File("#.xml"))));


Christian Oetterli ( christianoett ) - 2003-02-06 13:59

5

Closed

None

Nobody/Anonymous

None

None

Public


Comments ( 3 )

Date: 2006-06-19 21:14
Sender: polx

Logged In: YES
user_id=647450

The patch as included in the current SAXReader.java is not good to me!
Basically... it means that relative resolution is *not possible* for files
and it
also mean, for some weird reasons, to me, that encoding are handled wrong.

I am doing this experience with the maven xdoc plugin 1.9.2 and with jelly

1.1-SNAPSHOT and jelly xml-taglib 1.2-SNAPSHOT.

I would like to suggest two alternatives:
- consider that the "#" that could be in the file-name should probably be

URL-encoded (and do so if file.toURL() doesn't which seems to be the
case)
- or at least only use the FileInputStream alternative if there is such a
"#" and
only then.

I could provide patches and tests... later...

thanks

paul


Date: 2003-02-12 09:05
Sender: jstrachanProject Admin

Logged In: YES
user_id=65291

Fixed by Maarten


Date: 2003-02-12 00:04
Sender: maartencProject AdminAccepting Donations

Logged In: YES
user_id=178745

Fixed in CVS


Comments have been closed for this artifact.

Attached File

No Files Currently Attached

Changes ( 2 )

Field Old Value Date By
status_id Open 2003-02-12 09:05 jstrachan
close_date - 2003-02-12 09:05 jstrachan