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 aw...@hss.hns.com on 2002/10/17 11:08:29 UTC

Parsing XML and extracting data in data structures


Hi,
I have got an XML document in memory and I would like to extract data out of the
XML file into data-structures of my own. I need to extract whole of the XML file
into data structure and not part of the XML file. Can anyone
1)Provide me with a sample program/code to do the same. It does not seem that
any of the samples accompaing the code does this, specially using DOM.
2)Suggest which would be a better approach SAX or DOM? Note that I donot want to
manipulate the data. I just want to extract the data and put it into data
structures. I guess SAX would be faster.

regards
Alhad Wakankar



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


Re: Parsing XML and extracting data in data structures

Posted by Vijay Ganapati <vi...@clarussystems.com>.
I suspect you may also find Xalan useful, if you are using
DOM. Play around with a simple sample, and everything
you need is really in there...

----- Original Message -----
From: <aw...@hss.hns.com>
To: <xe...@xml.apache.org>
Sent: Thursday, October 17, 2002 2:08 AM
Subject: Parsing XML and extracting data in data structures


>
>
> Hi,
> I have got an XML document in memory and I would like to extract data out
of the
> XML file into data-structures of my own. I need to extract whole of the
XML file
> into data structure and not part of the XML file. Can anyone
> 1)Provide me with a sample program/code to do the same. It does not seem
that
> any of the samples accompaing the code does this, specially using DOM.
> 2)Suggest which would be a better approach SAX or DOM? Note that I donot
want to
> manipulate the data. I just want to extract the data and put it into data
> structures. I guess SAX would be faster.
>
> regards
> Alhad Wakankar
>
>
>
> ---------------------------------------------------------------------
> 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


Re: Parsing XML and extracting data in data structures

Posted by Gareth Reakes <ga...@decisionsoft.com>.
On Thu, 17 Oct 2002 awakankar@hss.hns.com wrote:

> 
> 
> Hi,
> I have got an XML document in memory and I would like to extract data out of the
> XML file into data-structures of my own. I need to extract whole of the XML file
> into data structure and not part of the XML file. Can anyone
> 1)Provide me with a sample program/code to do the same. It does not seem that
> any of the samples accompaing the code does this, specially using DOM.

DOM does take the entire XML file and put it into a data structure in 
memory. What about the DOM does not suit your needs?


> 2)Suggest which would be a better approach SAX or DOM? Note that I donot want to
> manipulate the data. I just want to extract the data and put it into data
> structures. I guess SAX would be faster.

SAX will probably be faster if you don't need the overhead of a complete 
DOM in memory. What kind of data are you trying to extract from the XML 
file?


Gareth

-- 
Gareth Reakes, Head of Product Development  
DecisionSoft Ltd.            http://www.decisionsoft.com
Office: +44 (0) 1865 203192



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