xom-interest AT lists.ibiblio.org
Subject: XOM API for Processing XML with Java
List archive
Re: [XOM-interest] Suggestion: add "public String getValue()"
- From: Elliotte Harold <elharo AT metalab.unc.edu>
- To: Wolfgang Hoschek <whoschek AT lbl.gov>
- Cc: xom-interest AT lists.ibiblio.org
- Subject: Re: [XOM-interest] Suggestion: add "public String getValue()"
- Date: Sat, 08 Jan 2005 08:56:21 -0500
Wolfgang Hoschek wrote:
Small suggestion: In XPath, the string value of a node sequence is well defined. So it might make sense to add a corresponding method "public String getValue()" to Nodes. That way, one could nicely use it over the result of an XPath or XQuery. Not really important, but it would be nice and consistent with other objects having an XPath getValue method.
node sequence: sounds like you're thinking XPath 2. Remember I'm thinking XPath 1. In XPath 1 the value of a node set is simply the value of the first node in the set (in document order). Since a XOM Nodes object can contain nodes from multiple documents, and nodes out of order, this is really tricky and probably not very useful.
What's the XPath 2 notion of string value of a node sequence? Just the string concatenation of the values of each node in the sequence? If this seems useful in its own right, I'd consider adding it. But I might want a use-case first. I don't know. XPath might provide that use case. Make the query, get the value?
--
Elliotte Rusty Harold elharo AT metalab.unc.edu
XML in a Nutshell 3rd Edition Just Published!
http://www.cafeconleche.org/books/xian3/
http://www.amazon.com/exec/obidos/ISBN=0596007647/cafeaulaitA/ref=nosim
-
[XOM-interest] Suggestion: add "public String getValue()",
Wolfgang Hoschek, 01/07/2005
- RE: [XOM-interest] Suggestion: add "public String getValue()", Michael Kay, 01/08/2005
- Re: [XOM-interest] Suggestion: add "public String getValue()", Elliotte Harold, 01/08/2005
Archive powered by MHonArc 2.6.24.