xom-interest AT lists.ibiblio.org
Subject: XOM API for Processing XML with Java
List archive
- From: Johannes Döbler <jd AT aztecrider.com>
- To: xom-interest AT lists.ibiblio.org
- Subject: Re: [XOM-interest] Tree walking
- Date: Thu, 19 Sep 2002 17:38:12 +0200
Visitor is straightforward to implement (see below)
Then the first NodeVisitor example could be the Serializer (with the pleasant side-effect that the ugly method "public void write(TreeNode node) throws IOException"
would vanish).
Problem: which types of exception is a NodeVisitor allowed to throw?
Johannes
------------------
public interface NodeVisitor
{
public void visitDocument(Document document);
public void visitElement(Element element);
public void visitText(Text text)
...
}
and Node gets a method
public abstract void accept(NodeVisitor visitor);
with implementations
Element.accept(NodeVisitor visitor)
{
visitor.visitElement(this);
}
etc. (ok, you knew that already :-))
At 10:33 AM +0200 9/19/02, Laurent Bihanic wrote:
- Tree walking: XOM should provide classes to ease walking document trees (TreeWalker, Visitor...).
Agreed. Right now I'm focusing on the core, and trying to make that solid. Tree walking utility classes will probably come later (or a third party could implement them separately).
--
+-----------------------+------------------------+-------------------+
| 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 mailing list
XOM-interest AT lists.ibiblio.org
http://lists.ibiblio.org/mailman/listinfo/xom-interest
-
Re: [XOM-interest] Firts impressions
, (continued)
- Re: [XOM-interest] Firts impressions, Elliotte Rusty Harold, 09/19/2002
- [XOM-interest] ClassLoader issues, Elliotte Rusty Harold, 09/19/2002
- [XOM-interest] Code compactness vs instanceof, Elliotte Rusty Harold, 09/19/2002
-
[XOM-interest] CDATA handling,
Elliotte Rusty Harold, 09/19/2002
-
Re: [XOM-interest] CDATA handling,
John Cowan, 09/19/2002
- Re: [XOM-interest] CDATA handling, Elliotte Rusty Harold, 09/19/2002
-
Re: [XOM-interest] CDATA handling,
John Cowan, 09/19/2002
-
[XOM-interest] Document portions,
Elliotte Rusty Harold, 09/19/2002
- Re: [XOM-interest] Document portions, Laurent Bihanic, 09/20/2002
- [XOM-interest] Automatic detach, Elliotte Rusty Harold, 09/19/2002
-
[XOM-interest] Tree walking,
Elliotte Rusty Harold, 09/19/2002
-
Re: [XOM-interest] Tree walking,
Johannes Döbler, 09/19/2002
- Re: [XOM-interest] Tree walking, Elliotte Rusty Harold, 09/19/2002
-
Re: [XOM-interest] Tree walking,
Johannes Döbler, 09/19/2002
-
[XOM-interest] HTML Serializer,
Elliotte Rusty Harold, 09/19/2002
- Re: [XOM-interest] HTML Serializer, a student, 09/19/2002
- [XOM-interest] Element.getNamespacePrefix() vs Attribute.getPrefix(), Elliotte Rusty Harold, 09/19/2002
-
[XOM-interest] Element.add(),
Elliotte Rusty Harold, 09/19/2002
- Re: [XOM-interest] Element.add(), John Cowan, 09/19/2002
-
[XOM-interest] Node.howManyChildren(): getChildCount(),
Elliotte Rusty Harold, 09/19/2002
-
Re: [XOM-interest] Node.howManyChildren(): getChildCount(),
John Cowan, 09/19/2002
- Re: [XOM-interest] Node.howManyChildren(): getChildCount(), Rolf Lohaus, 09/19/2002
-
Re: [XOM-interest] Node.howManyChildren(): getChildCount(),
John Cowan, 09/19/2002
Archive powered by MHonArc 2.6.24.