[jdom-interest] Element Reference from Attribute
Elliotte Rusty Harold
elharo at metalab.unc.edu
Mon Nov 20 04:53:30 PST 2000
At 10:10 AM -0800 11/19/00, Jason Hunter wrote:
>> 2. Using Strings instead of a Text class is extremely inconvenient.
>
>With a design so that getMixedContent() returned a list including node
>of type Text but getText(), or some such method, still returned a
>String? It's a hard requirement that you can get a String from an
>Element.
>
I propose this method:
public String getValue()
This would return the XPath defined value of the Element, Attribute,
Comment, etc. You could even call it getText() if you preferred,
though I think getValue() is more consistent with other specs. I
only foresee Text nodes being returned as members of the list
returned by getChildren() or getMixedContent().
--
+-----------------------+------------------------+-------------------+
| Elliotte Rusty Harold | elharo at metalab.unc.edu | Writer/Programmer |
+-----------------------+------------------------+-------------------+
| The XML Bible (IDG Books, 1999) |
| http://metalab.unc.edu/xml/books/bible/ |
| http://www.amazon.com/exec/obidos/ISBN=0764532367/cafeaulaitA/ |
+----------------------------------+---------------------------------+
| Read Cafe au Lait for Java News: http://metalab.unc.edu/javafaq/ |
| Read Cafe con Leche for XML News: http://metalab.unc.edu/xml/ |
+----------------------------------+---------------------------------+
More information about the jdom-interest
mailing list