[rant]
Grrrr, Sun's annoying me. I've been wasting my time trying to get a problem fixed that I don't think can be fixed other than by emailing Sun - but there is a chocolate fish there for anyone that solves this for me :)
Basically, Properties in Java can now be XML. I thought "swell, let's use that". As specified in the JavaDoc here it is necessary to include the DTD reference at the top of the properties file. That is no problem, as the file contents is listed on the page. When I save the xml in XML Spy however, it complains that the DTD is invalid. Looking at the file 'http://java.sun.com/dtd/properties.dtd', it is slightly different than what is on the page: it now has a nice copyright message and whitespace. It appears that this is causing the DTD to be invalid. It doesn't matter, the Properties object still happily parses it so no problem there.
Today I wrote some code to actually change property values and write them back to the XML (retaining all comments, etc). I set the DocumentBuilderFactory to not validate the file, as I knew it wasn't valid thanks to Suns DTD. However, I still get errors when trying to parse it due to the unexpected statement in the DTD.
I thought I could get around this by copying the DTD to my local codebase and using it there - but the Java Properties object expects a hard coded reference to their DTD or else it fails - so there goes that idea.
As far as I can tell, Sun is the single point of failure in my code, and they decided to fail.
Anyone have any ideas? It appears others have found my problem, like here.
[/rant]
Please let me know,
Jonathan Giles.
1 comment:
I just found this bug report here.
It's amazing that this has been a bug since 30th May and only requires a minor edit and upload of a file.
Post a Comment