Skip to Content.
Sympa Menu

xom-interest - Re: [XOM-interest] 1.0d5 is available: no breaking changes; all users should upgrade

xom-interest AT lists.ibiblio.org

Subject: XOM API for Processing XML with Java

List archive

Chronological Thread  
  • From: Elliotte Rusty Harold <elharo AT metalab.unc.edu>
  • To: John Cowan <jcowan AT reutershealth.com>
  • Cc: xom-interest AT lists.ibiblio.org
  • Subject: Re: [XOM-interest] 1.0d5 is available: no breaking changes; all users should upgrade
  • Date: Sun, 6 Oct 2002 13:28:10 -0400

At 12:52 PM -0400 10/6/02, John Cowan wrote:
Elliotte Rusty Harold scripsit:

Finally, I added an experimental build method to Builder that builds
a XOM Document directly from a String containing well-formed XML.

public Document build(String document, String baseURI)

Presumably this just wraps the String in a StringReader. Is there any
benefit to XOM doing this vs. the user doing it? It seems like one of
those trivial convenience methods XOM doesn't have, by design.

Yes, that's pretty much what it does. However, there are a couple of advantages here. One is that JDOM convinced me that using a StringReader is not at all obvious to many users. How to do this is very much a FAQ in JDOM. The second, more important, issue is that this approach requires the user to provide a base URI.

Note that although XOM supports them, not all Java virtual machines
do. In particular 10 and up are often unavailable.

So if the JVM doesn't support it, you get an UnsupportedEncodingException?


Exactly. I thought about omitting those encodings the JVM doesn't support, but this is one thing that really does vary a lot from vendor to vendor, from version to version, and even from platform to platform.
--

+-----------------------+------------------------+-------------------+
| Elliotte Rusty Harold | elharo AT metalab.unc.edu | Writer/Programmer |
+-----------------------+------------------------+-------------------+
| XML in a Nutshell, 2nd Edition (O'Reilly, 2002) |
| http://www.cafeconleche.org/books/xian2/ |
| http://www.amazon.com/exec/obidos/ISBN%3D0596002920/cafeaulaitA/ |
+----------------------------------+---------------------------------+
| Read Cafe au Lait for Java News: http://www.cafeaulait.org/ |
| Read Cafe con Leche for XML News: http://www.cafeconleche.org/ |
+----------------------------------+---------------------------------+




Archive powered by MHonArc 2.6.24.

Top of Page