xom-interest AT lists.ibiblio.org
Subject: XOM API for Processing XML with Java
List archive
- From: Elliotte Rusty Harold <elharo AT metalab.unc.edu>
- To: "Tom Hurley" <tom_hurley AT anabus.com>
- Cc: xom-interest AT lists.ibiblio.org
- Subject: Re: [XOM-interest] Comprehension question
- Date: Fri, 16 Jan 2004 15:52:27 -0500
How come there isn't a Builder.build(Nodes nodes) function in the Builder
class that can be used to create a document?
The purpose of the Builder class is to build from a raw stream that forms the actual XML document. This can be presented in a variety of ways: InputStream, File, Reader, String, etc. However, these are all different ways of looking at the actual characters that make up the real XML. A Nodes object is very different.
There might be a reason to provide a class that converts a Nodes object into a document. It's the sort of thing I might consider for a planned util package in 1.1 if there's demand. However, I don't think Builder is the right place to put it.
You also need to keep in mind that what you ask is trickier in general than it probably is in your specific case. In the general case, a Nodes object may contain multiple elements and other nodes, including Attribute and Text objects. Some of these nodes may already have parents, and indeed may reside in different documents. So it's not obvious to me that this problem can be solved in the general case. You probably need more detailed information about the nature of the content of the Nodes object.
--
Elliotte Rusty Harold
elharo AT metalab.unc.edu
Effective XML (Addison-Wesley, 2003)
http://www.cafeconleche.org/books/effectivexml
http://www.amazon.com/exec/obidos/ISBN%3D0321150406/ref%3Dnosim/cafeaulaitA
-
[XOM-interest] Comprehension question,
Tom Hurley, 01/16/2004
- Re: [XOM-interest] Comprehension question, Elliotte Rusty Harold, 01/16/2004
Archive powered by MHonArc 2.6.24.