xml-general mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Nash <David.N...@WallStreetSystems.com>
Subject RE: Very much a newbie needing an example
Date Thu, 31 Jan 2002 11:09:57 GMT
> From: Jeff Shipman [mailto:shippy@nmt.edu]
> Sent: 30 January 2002 01:26

Hi, Since noone seems to have answered you I'll give it a go.  I 
am not closely related to Apache/Xerces or any of that though, 
just a user like you.

> Hello everyone. I could not seem to find a
> Xerces-C Users list so I am posting here.
> If there is a more appropriate place to post,
> please point me in that direction.

No, there doesn't seem to be one.  There is a developers's list though
which you may want to check out.

> I am very new to Xerces and XML in general.
>  From what I gather, SAX 1 and 2 are different
> types of parsers (the benefits of one over
> the other I'm not sure. I'm assuming 2 is
> newer) and DOM is a way of representing a
> SAX-parsed document in memory.

SAX 1 and 2 are different versions of the Simple API for XML.  Xerces
supports both (I think).  Check out http://www.saxproject.org

DOM is an alternative.  The main difference is that with SAX, you set up
a "handler" class that the parser keeps calling back each time it finds 
different parts of the XML document, like start and end of elements, 
text, and so on.  It's up to you what you do with that information.
With DOM, you call the parser and it builds its own tree based on the W3C
Document object model (see http://www.w3.org/DOM), which you can then access
to get the information yourself.  You can also build a DOM structure from 
scratch in memory, or modify one you've parsed.

> I've looked through the samples, but I'm not
> quite finding what I'm looking for. I just
> need a very simple C++ example of parsing
> an XML file and writing an XML file. My
> XML file will be very simple. Something
> like this:

Try looking at the SAXPrint and DOMPrint examples in the Xerces samples
directory.  Also the CreateDOMDocument one to see how to create, well, a 
DOM Document. 

> Thanks in advance,

Happy to help.


View raw message