xom-interest AT lists.ibiblio.org
Subject: XOM API for Processing XML with Java
List archive
- From: Wolfgang Hoschek <whoschek AT lbl.gov>
- To: Peter Murray-Rust <pm286 AT cam.ac.uk>
- Cc: xom-interest AT lists.ibiblio.org
- Subject: Re: [XOM-interest] User Questions
- Date: Mon, 1 Aug 2005 16:30:22 -0700
* What is the role of a Document (it is much less central than in W3C).
Obviously it holds the prolog, etc.
In DOM a Document acts as factory, in XOM it doesn't.
I note that it cannot be detached
from its rootElement. (I sometimes need to replace a rootElement with
its child, and this seems to be forbidden without copying the tree.
It works via child.detach(), followed by doc.setRootElement(child).
This ends up detaching the former root element. Moving nodes around is easier in XOM than in DOM.
* Is is possible to serialize a Node other than document without making
a copy?
You can subclass Serializer go gain access to its protected methods such as writeNode().
Note, however that if you are using namespaces, you may (or may not) be in trouble as
the XOM Serializer assumes that an entire document is written, rather than arbitrary
subtrees. Thus, when serializing arbitrary nodes it can potentially "forget" to output namespace declarations, resulting in malformed output.
(I have a Nux ResultSequenceSerializer.write(Nodes) that works around those potential problems without requiring copying, though it's not yet released.)
Wolfgang.
-
[XOM-interest] User Questions,
Peter Murray-Rust, 08/01/2005
-
Re: [XOM-interest] User Questions,
Wolfgang Hoschek, 08/01/2005
- Re: [XOM-interest] User Questions, Peter Murray-Rust, 08/02/2005
-
Re: [XOM-interest] User Questions,
Elliotte Rusty Harold, 08/03/2005
-
Re: [XOM-interest] User Questions,
Peter Murray-Rust, 08/03/2005
- Re: [XOM-interest] User Questions, Michael Kay, 08/04/2005
- [XOM-interest] Copy functionality for subclassed Elements and Attributes, Peter Murray-Rust, 08/07/2005
-
Message not available
-
Message not available
-
Message not available
-
Re: [XOM-interest] User Questions,
Elliotte Harold, 08/12/2005
- Re: [XOM-interest] User Questions, Wolfgang Hoschek, 08/12/2005
-
Re: [XOM-interest] User Questions,
Elliotte Harold, 08/12/2005
-
Message not available
-
Message not available
-
Re: [XOM-interest] User Questions,
Peter Murray-Rust, 08/03/2005
-
Re: [XOM-interest] User Questions,
Wolfgang Hoschek, 08/01/2005
Archive powered by MHonArc 2.6.24.