You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@xerces.apache.org by "Purdy, Edgar M" <ed...@lmco.com> on 2003/12/22 21:24:11 UTC

Tutorials

I am trying to implement the DOMPrint sample with Xerces to parse the sample data file personal.xml.  I want it to extract only the following info, and not repeat the entire file as it does now.  
I want to extract the tag "person id" and its value "Big.Boss".  
Then the tag "email" and its value "chief@foo.com".  
Then the tag "link subordinates" and its value "one.worker two.worker three.worker four.worker five.worker"  etc......

Any help is greatly appreciated.

The first record in the file reads like this:
- <person id="Big.Boss"> 
 <name> 
<family>Boss</family> 
<given>Big</given> 
</name> 
<email>chief@foo.com</email> 
<link subordinates="one.worker two.worker three.worker four.worker five.worker" /> 
</person>



Are there any c++ tutorials on line for Xerces?  



Ed Purdy

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


Re: Tutorials

Posted by Gareth Reakes <ga...@decisionsoft.com>.
Hi,
	go and take a look at a XML tutorial. You are not looking for a person 
id tag, but rather a person element (or tag) and its attribute called 
id. After you have read that take a look at a DOM tutorial otherwise 
further things will bite you (such as getNodeValue giving what you want 
with an attribute, but not element). If you are still having problems 
after this then post a code snippet and we will give advice.

Cheers,

Gareth

On 22 Dec 2003, at 20:24, Purdy, Edgar M wrote:

> I am trying to implement the DOMPrint sample with Xerces to parse the 
> sample data file personal.xml.  I want it to extract only the 
> following info, and not repeat the entire file as it does now.
> I want to extract the tag "person id" and its value "Big.Boss".
> Then the tag "email" and its value "chief@foo.com".
> Then the tag "link subordinates" and its value "one.worker two.worker 
> three.worker four.worker five.worker"  etc......
>
> Any help is greatly appreciated.
>
> The first record in the file reads like this:
> - <person id="Big.Boss">
>  <name>
> <family>Boss</family>
> <given>Big</given>
> </name>
> <email>chief@foo.com</email>
> <link subordinates="one.worker two.worker three.worker four.worker 
> five.worker" />
> </person>
>
>
>
> Are there any c++ tutorials on line for Xerces?
>
>
>
> Ed Purdy
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
> For additional commands, e-mail: xerces-c-dev-help@xml.apache.org
>
>


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