Skip to Content.
Sympa Menu

xom-interest - RE: [XOM-interest] Convenience methods for adding text in ParentNode

xom-interest AT lists.ibiblio.org

Subject: XOM API for Processing XML with Java

List archive

Chronological Thread  
  • From: "Michael Fitzgerald" <mike AT wyeast.net>
  • To: "Elliotte Rusty Harold" <elharo AT metalab.unc.edu>, "XOM" <xom-interest AT lists.ibiblio.org>
  • Subject: RE: [XOM-interest] Convenience methods for adding text in ParentNode
  • Date: Tue, 22 Oct 2002 06:29:22 -0700

Likewise, I think

nu.xom.Node getNextSibling()
nu.xom.Node getPreviousSibling()

could move to Element as a child of Document (the document element) would
never have an Element sibling. Or do you consider items in the prolog
(comments and PIs) to have sibling relationships? I trow not.

Mike
> -----Original Message-----
> From: xom-interest-admin AT lists.ibiblio.org
> [mailto:xom-interest-admin AT lists.ibiblio.org]On Behalf Of Elliotte Rusty
> Harold
> Sent: Sunday, October 20, 2002 1:09 PM
> To: xom-interest
> Subject: [XOM-interest] Convenience methods for adding text in
> ParentNode
>
>
> ParentNode contains a couple of methods that automatically convert a
> String to a text node; e.g.
>
> public final void insertChild(int position, String text) {
> public final void appendChild(String text) {
>
> It occurred to me that since you can't actually add a text node to a
> Document, perhaps these should be pushed down to Element instead.
> Thoughts?
>
> The real question is whether there's any use-case that requires
> adding text content to a node whose type is known only as ParentNode.
> Off the top of my head I can't think of one; and even if there is, it
> still be possible to do parent.appendChild(new Text("some string"))
>
>
> --
> Elliotte
>
> _______________________________________________
> XOM-interest mailing list
> XOM-interest AT lists.ibiblio.org
> http://lists.ibiblio.org/mailman/listinfo/xom-interest
>





Archive powered by MHonArc 2.6.24.

Top of Page