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 Dean Roddey <dr...@charmedquark.com> on 2001/09/24 04:10:42 UTC

Re: Sax and Dom Parser

Just create your own simple data structure. When you find a bit you want to keep, stick it into your data structure for later use. If your collected data needs to be a tree as well, then you'll have to use a tree type collection of some sort. If its just flat and you don't care about maintaining the tree structure that it was originally in, just any sort of simple expanding vector collection would do.

--------------------------
Dean Roddey
The Charmed Quark Controller
Charmed Quark Software
droddey@charmedquark.com
http://www.charmedquark.com

"If it don't have a control port, don't buy it!"


  ----- Original Message ----- 
  From: Keno 
  To: Xerces-C Dev 
  Sent: Sunday, September 23, 2001 7:12 PM
  Subject: Sax and Dom Parser


  Hello all, Im currently using a SaxParser to go through my XML document. Now I would like to investigate certain parts of the document to do some analysis. This is a large file could be up to 50MB and up which is why instinctively I chose the Sax parser over DOM. Certain parts of the file will look as below:

  ...
  <head>
       <body>
               <content>something</content>
       </body>
  </head>
  ...

  I would like to get sub-trees of the XML document that look like above. Is there anyway that while using Sax I can somehow get the tree building capabilities of DOM so that I can gather the info in the sub-trees? 

  What I want to do is create a report something like below:

  Heading : this will contain what is in the "head" tag 
  Report :  this will contain what is in the "content" tag

  Any help would be appreciated.


  - Keno -