nedcomp hosting homepage

Producten en Diensten
Dedicated servers
Datacenter informatie
Partners, resellers
Helpdesk informatie
Technische docs, tools
Support homepage
ASP componenten
Praktische ASP, ASP.NET
Visual route server
Whois (domein gegevens)
Software documentatie
Whitepapers
Zoeken
Nedcomp / algemeen

Zoeken
 

Copyright © Nedcomp Hosting
Telefoon nr :   +31 184 670111
Fax nummer :   +31 184 631384
E-mailadres :   info@nedcomp.nl
 

Microsoft XML Core Services (MSXML) 4.0 - SAX2 Developer's Guide

How Events-Based Parsing Works

To appreciate the benefits of the Microsoft COM implementation of the Simple API for XML (SAX), it helps to understand how you can use SAX2 to process XML documents. The SAX2 parser reads an XML document and generates events based on specific symbols that it encounters in the document. The SAX2 parser does not create a tree structure in memory for the document, although you can programmatically instruct it to do so. Rather, the SAX2 parser processes a document's contents sequentially and generates events as it reads through the document.

When you write an application based on events-based programming, you create functions to respond to user-generated events, such as the OnClick event. Writing an application for an events-based parser is similar. However, in the case of SAX, the parser, not a user, generates the events.

Consider the following simplified document.

<?xml version="1.0"?>
<parts>
<part>TurboWidget</part>
</parts>

As the SAX2 parser processes this document, it generates a sequence of events such as the following.

StartDocument( )
StartElement( "parts" )
StartElement( "part" )
Characters( "TurboWidget" )
EndElement( "part" )
EndElement( "parts" )
EndDocument( )

Think of SAX2 as a push parser. SAX2 generates the events and you implement the event handlers that contain methods to process the events. For more information about event handlers and how to implement them, see JumpStart for Creating a SAX2 Application.


Download de SDK