P
Peter Duniho
It is worth noting that distributing with Xerces would not break WORA.
Sure. But it _would_ break my other goal of not having to distribute
additional components with my application.
Xeres is pure Java.
If it is an applet, then the size of the Xerces jar could be a problem,
but for desktop and server apps it is not a problem.
It's an application, but a small, relatively simple one. Its JAR is only
400K, and it's only that big because it's got a poorly-compressed AIFF
audio clip in it (accounting for the lion's share of that size). I don't
know how large the Xerces (or similar) download would be, but I suspect it
could equal or exceed the total size of my application (and that even
assumes that I don't eventually figure out how to get the audio clip to be
an MP3 instead...if I can get the audio clip's size down to something
reasonable for its length, the disparity would be that much larger).
I'm also not interested in introducing installation complexities, such as
those that might be required as part of delivering a third-party component
with the application.
And it is not just me thinking so.
I just checked my harddrive. I have 68 copies of Xerces. Because
so many apps come with it.
BEA, Borland, SUN, JBoss, IBM, Apache, Oracle.
Well, I have to say: just because everyone else is doing it, that doesn't
mean it's a good idea. Also, what's reasonable to include with an
application depends a lot on how large that application is.
Maybe if my application were larger, and maybe if I needed some specific
XML implementation behavior that that particular package provides, it
would be something I'd consider.
However, I've got a much better solution (and this is thanks to you, for
what it's worth ). The only problem with the solutions offered here
was that the built-in XML implementation wasn't handling indentation
properly, and the XSLT-based work-around I found on that previous link
addresses that nicely (the single-character linefeed in the XSLT even gets
converted to the CR/LF pair when running on the Windows Java
implementation), without introducing any implementation-specific
dependencies.
So now I've got my application working just fine (well, with respect to
the XML ), with a minimal amount of code, and without any dependency
other than the original Java 5 requirement.
Pete