[jdom-interest] debug everywhere

Paul Libbrecht paul at activemath.org
Mon Jan 22 01:24:41 PST 2007


Just for the sake of completeness, there's a funny story behind this on 
dom4j:

- in JDOM, you can use SAXReader.read(File) which is mostly the same as 
File.toURI().toString() and that's good and should be such (it is good 
since it allows relative resolution of, e.g., DTD references)
- in dom4j, there's a guy that discovered that file.toURL() does not 
url-encode # hence turns a file with a # into a reference with an inner 
id-reference... and they use this as an excuse not to use file.toURI() 
when receiving a file, hence breaking all file-reading relative resolution.

Luckily File.toURI() does URL-encode #... but maybe it only comes in 
modern flavours of JDK ?

paul


Michael Kay wrote:
>> To avoid treading the trepidating & unknown (at least, to me) 
>> path towards using systemId, what I currently do is simply 
>> create an InputSource from a File.
>>     
>
> File.toURI().toString()
>
> is a pretty reliable recipe.
>
> Michael Kay
> http://www.saxonica.com/
>
>   
>> -----Original Message-----
>> From: jdom-interest-bounces at jdom.org
>> [mailto:jdom-interest-bounces at jdom.org] On Behalf Of Jason Hunter
>> Sent: Friday, January 19, 2007 6:00 PM
>> To: dmatthews at inbox.lv
>> Cc: jdom-interest at jdom.org
>> Subject: Re: [jdom-interest] debug everywhere
>>
>> When you pass a string to the build() command you are passing 
>> a systemId, not a path to file.  Internally it's converted to 
>> a SAX InputSource.  Odds are it's a backslash related issue 
>> in that you were lucky sometimes your file path worked as a 
>> systemId, but on Windows it doesn't because of C: and backslashes.
>>
>> -jh-
>>
>> This email and any files transmitted with it are confidential 
>> and intended solely for the use of the individual or entity 
>> to whom they are addressed. If you have received this email 
>> in error please notify the sender immediately. Please note 
>> that any views or opinions presented in this email are solely 
>> those of the author and do not necessarily represent those of 
>> the company. Even though this company takes every precaution 
>> to ensure this email is virus-free, the recipient should 
>> check this email and any attachments for the presence of 
>> viruses. The company accepts no liability for any damage 
>> caused by any virus transmitted by this email.
>> Protedyne Corporation, 1000 Day Hill Rd, Windsor, CT 06095, 
>> USA,                                                                  
>> www.protedyne.com
>>
>>     

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 2938 bytes
Desc: S/MIME Cryptographic Signature
Url : http://www.jdom.org/pipermail/jdom-interest/attachments/20070122/fa455e49/smime.bin


More information about the jdom-interest mailing list