xom-interest AT lists.ibiblio.org
Subject: XOM API for Processing XML with Java
List archive
[XOM-interest] 1.0d5 is available: no breaking changes; all users should upgrade
- From: Elliotte Rusty Harold <elharo AT metalab.unc.edu>
- To: xom-interest AT lists.ibiblio.org
- Subject: [XOM-interest] 1.0d5 is available: no breaking changes; all users should upgrade
- Date: Sun, 6 Oct 2002 10:24:06 -0400
I'm pleased to announce version 1.0d5 of XOM in the usual location:
http://www.cafeconleche.org/XOM/
This release makes no backwards incompatible changes to the API. All code that previously compiled and ran with 1.0d4, should still compile and run. New features in the API in this release include:
toXML(), equals(), hashCode(), and toString() methods in the Attribute.Type inner class. Environments with multiple class loaders should use the equals() method instead of direct equality comparison.
I did a lot of work on the Builder class. First off, there's a new method that builds a XOM Document from a java.io.File.
public Document build(File in)
I added two more build methods to Builder that allow the base URI to be specified when building from a Reader or an InputStream.
public Document build(InputStream in, String baseURI)
public Document build(Reader in, String baseURI)
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)
I'm not convinced of this one's utility yet. Feedback is appreciated.
I also cleaned up the internal code in Builder substantially by refactoring duplicate code into private methods and fixed a bug that was preventing the default XMLReader from being loaded in some circumstances
Serializer also underwent major improvements. It now supports all defined ISO-8859 character sets, including:
* ISO-8859-1
* ISO-8859-2
* ISO-8859-3
* ISO-8859-4
* ISO-8859-5
* ISO-8859-6
* ISO-8859-7
* ISO-8859-8
* ISO-8859-9
* ISO-8859-10
* ISO-8859-11
* ISO-8859-13
* ISO-8859-14
* ISO-8859-15
* ISO-8859-16
Note that although XOM supports them, not all Java virtual machines do. In particular 10 and up are often unavailable.
Serializer now matches character set names case-insensitively as suggested by the XML specification.
I also fixed several serialization bugs including one in UnicodeWriter that was preventing reserved characters such as & and < from being escaped when the encoding was some variant of Unicode. (This is more evidence that premature optimization is the root of all evil. I just couldn't resist an obvious optimization in the UnicodeWriter class, and it came back to bite me in the ass.) and a cosmetic bug that added unnecessary xmlns="" declarations on root elements by Serializer and toXML in Element. Finally, I fixed the incorrect hexadecimal escape sequences generated by TextWriter.
This all goes to prove how important unit testing is. Serializer has had by far the most and worst bugs in the project to date. Not coincidentally, it has not had any unit tests until this release. Although this release adds about a dozen new tests for serialization, they still don't cover the class's functionality as well as I'd like. More work is needed.
--
+-----------------------+------------------------+-------------------+
| 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/ |
+----------------------------------+---------------------------------+
-
[XOM-interest] 1.0d5 is available: no breaking changes; all users should upgrade,
Elliotte Rusty Harold, 10/06/2002
-
Re: [XOM-interest] 1.0d5 is available: no breaking changes; all users should upgrade,
John Cowan, 10/06/2002
- Re: [XOM-interest] 1.0d5 is available: no breaking changes; all users should upgrade, Elliotte Rusty Harold, 10/06/2002
-
Re: [XOM-interest] 1.0d5 is available: no breaking changes; all users should upgrade,
John Cowan, 10/06/2002
Archive powered by MHonArc 2.6.24.