xerces-c-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alberto Massari <amass...@progress.com>
Subject Re: question about QElement::getElementsByTagName()
Date Mon, 08 Mar 2004 13:29:38 GMT
Hi Peter,

At 14.24 08/03/2004 +0100, Peter Billen wrote:
>Hi all,
>I have a question about the getElementsByTagName()-function.
>Imagine following simple xml structure:
>         <huh>woezaa</huh>
>I'm using DOM to parse the file. But why is the following printing 'huh' and
>not 'woezaa', when I'm currently in <bla>?
>if (strcmp(currentNode->getNodeName(), "bla") == 0)
>         DOMText* nodeLocation = (DOMText*) (((DOMElement*)
>         cout << XMLString::transcode(nodeLocation->getData());

getElementsByTagName returns a list of elements having the specified name; 
item(0) will get you the first in the list (that is, "huh"). If you want to 
get the DOMText that contains "woezaa" you need to change it to be 


To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org

View raw message