A little context: the reason this is necessary is that element nodes don't
have a value per se. (See the table at
http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-19
50641247.) The data you're looking for is stored in text nodes that are
children of the Name elements.

-----Original Message-----
From: jiang lei [mailto:[EMAIL PROTECTED]
Sent: Sunday, March 16, 2003 7:29 PM
To: [EMAIL PROTECTED]
Subject: Re: extracting data from dom


hi Keno,

I think you have to use 'getFirstChild()' to get the text node of  each ITEM
as well.
Under element 'Project' there is an element named 'Name'. Your code listed
here only get the element 'Name', element 'Descript', etc.

regards

Lei

----- Original Message -----
From: "Okeno Palmer" <[EMAIL PROTECTED]>
To: "Xerces-C Dev" <[EMAIL PROTECTED]>
Sent: Sunday, March 16, 2003 1:04 PM
Subject: extracting data from dom


>
> <ProjectCollection>
>     <Project>
>         <Name>String</Name>
>         <Description>String</Description>
>         <Rate>3.14159265358979</Rate>
>     </Project>
> </ProjectCollection>
>
> ...
>  for(int i = 0; i < projNodes->getLength(); i++)
>  {
>     DOMNode *project = projNodes->item(i);
>     DOMNode *child = project->getFirstChild();
>
>     cout << child->getNodeValue();
>  }
>
> Any ideas folks as to why I wouldn't be getting the actual value of the
Name
> element instead of empty string??
>
>
> .:. Keno .:.

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

Reply via email to