Skip to Content.
Sympa Menu

xom-interest - [XOM-interest] XOM 1.0d4 has been posted

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: xom-interest AT lists.ibiblio.org
  • Subject: [XOM-interest] XOM 1.0d4 has been posted
  • Date: Sat, 28 Sep 2002 17:26:47 -0400

The major addition in 1.0d4 are methods to get and set the base URI of a
node. You can invoke getBaseURI from any Node object to retrieve the URL
against which relative URLs in that Node should be resolved. This is
calculated
in keeping with XML Base. That is, if an xml:base attribute is in scope its
value is used. Otherwise, the URI of the entity in which the Node appears is
loaded. You can change the underlying URI of the entity using the setBaseURI
method in ParentNode. When a document is built, the parser fills in the base
URI for each node. This is stored separately from xml:base attributes, which
are not treated differently than any other attribute. When a document is
serialized, you may request that the serializer fill in extraxml:base
attributes not present in the infoset to preserve the underlying base URIs.
However, since this is a structural change to the document, this feature is
turned off by default.

Other API level changes include:

The Attributes and Namespaces classes are no longer part of the public
API. Instead the Element class has these four public methods:

public Attribute getAttribute(int index)
public int getAttributeCount()
public int getNamespaceDeclarationCount()
public void getNamespacePrefix(int i)

getStringForm has been renamed toXML

readAttribute has been renamed getAttributeValue

addAdditionalNamespace has been renamed declareNamespace

The removeChildren method has been moved from ParentNode into Element
because it's impossible to remove all the children of a Document.

The following protected methods allow subclasses to monitor insertions and
deletions from subclasses of Element and Document:

public void checkInsertChild()
public void checkRemoveChild()

The following protected methods allow subclasses of Element to monitor
namespace declarations:

public void checkAddNamespaceDeclaration()
public void checkRemoveNamespaceDeclaration()

The following protected methods allow subclasses of Element to monitor
changes of local name, namespace prefix, and namespace URI:

public void checkLocalName()
public void checkNamespacePrefix()
public void checkNamespaceURI()

The missing write(DocType) method has been added to Serializer. This fixes
a nasty infinite recursion when serializing documents with document type
declarations.

In addition several bugs were fixed, the JavaDoc was further
cleaned up and improved, and more than a dozen new unit tests were added.
--

+-----------------------+------------------------+-------------------+
| 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