Yes you are right this is one of the most common questions.
It is in the FAQ just because of that.
Read the FAQ at www.apache.org and take a look at the Xerces DOMPrint
example.

Regards

Erik Rydgren
Mandarinen systems AB
Sweden


-----Original Message-----
From: �L �l�� [mailto:[EMAIL PROTECTED]]
Sent: den 7 maj 2002 17:48
To: [EMAIL PROTECTED]
Subject: about printing out text to the console using DOM




hi, i know this is one of the most fundermental question u will get get,
but i was wondering how to print out the content from a elemnt node? do i
suppose to use getNodeValue() to obtain the text within the element node?
anyway here is the example:

a.xml
<?xml version="1.0"?>
<list>
<doc>hi</doc>
</list>

the code i use is :
//some parsing code
...
const DOM_Document theDOM = theParser->getDocument();

//Get a list of elements that lies within the List tag
DOM_NodeList Node_list = theDOM.getElementsByTagName("list");
DOM_Element elm = (DOM_Element&) Node_list.item(0);

if(!elm.isNull())
{
cerr<<"i am in!\n";
     DOM_NodeList docList = elm.getElementsByTagName("doc");
     DOM_Element doc = (DOM_Element&) docList.item(0);
     DOMString temp =  doc.getNodeValue();
     temp.print();
}

this code will not print the text ("hi") to the console, so i was wondering
is there some i miss out within the code? any suggestion will be a great
help
Many thanks
Regards
Kit


_________________________________________________________________
�ϥΥ��y�̦h�H�ϥΪ��q�l�l��A�� MSN Hotmail�Ghttp://www.hotmail.com


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to