[thelist] [SOLVED] Java, JSP & XML

Boris Mann boris at bmannconsulting.com
Mon Mar 10 11:32:01 CST 2003


On Monday, March 10, 2003, at 12:29 PM, Jacques Capesius wrote:

> Never mind, all.
>
> I was able to pull the field value by replacing the line:
>
> out.println(cl.item(0).getNodeValue() + "<br>")
>
> with
>
> out.println(cl.item(0).getFirstChild().getNodeValue() + "<br>");

Yes, this can be confusing. Essentially, the text contents of a tag are
themselves a "child" of the tag. Other APIs (such as JDOM [1]) have
convenience methods, usually called something like
"getFirstChildValue", that do it all in one go.

[1] http://www.jdom.org

--
Boris Mann
http://www.bmannconsulting.com




More information about the thelist mailing list