Skip to Content.
Sympa Menu

xom-interest - [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: Elliotte Rusty Harold <elharo AT metalab.unc.edu>
  • To: xom-interest <xom-interest AT lists.ibiblio.org>
  • Subject: [XOM-interest] Convenience methods for adding text in ParentNode
  • Date: Sun, 20 Oct 2002 16:08:33 -0400

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





Archive powered by MHonArc 2.6.24.

Top of Page