W3C home > Mailing lists > Public > www-dom@w3.org > April to June 2000

text nodes and element nodes

From: andrew atkinson <andrew@wellengaged.com>
Date: Mon, 10 Apr 2000 18:25:24 -0400 (EDT)
Message-ID: <38F25518.AC73483F@wellengaged.com>
To: www-dom@w3.org

I'm not sure what is going on here. We have the following code segment

String xmlSid = SessionManager.createNewSession("edmunds", "0");
    StringBufferInputStream sbisd = new StringBufferInputStream(xmlSid);

    InputSource isid = new InputSource(sbisd);
    Element sessionInfo =

This returns us the correct Element, however when we work through the
Element to get the required node, it has ELEMENT_NODE type, this means
we can't retrive the value

the Element looks like


the code we use to try and get the value is

NodeList sessionTag = sessionInfo.getElementsByTagName("*");
Node st = sessionTag.item(0);
String sid = st.getNodeValue();

However as I said the Node st is of type ELEMENT_NODE, I seem to have no
control over this, what can I do to ensure its a text node, which it
looks like to me?

Received on Monday, 10 April 2000 18:33:48 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 20 October 2015 10:46:06 UTC