SAX Based Decode Methods
If -sax is specified on the XBinder command-line, the code generated to decode XML messages uses off-the-shelf XML parser software to parse the XML documents to be decoded. This software contains a common interface known as the Simple API for XML (or SAX) that is a de-facto standard that is supported by most parsers. XBinder generates an implementation of the content handler interface defined by this standard. This implementation receives the parsed XML data and uses it to populate the structures generated by the compiler.
The default XML parser used is the EXPAT parser (http://www.expat.org). This is a lightweight, open-source parser that was implemented in C. XBinder generates C++ SAX handler classes within the generated type class for a given XML schema type. The methods within these classes are called from the SAX interface of the XML parser framework to decode XML data into the generated typed data structures. The interface was designed to be generic so that other XML parsers could be easily substituted.
3. A custom micro-SAX parser. This is a bare-boned XML parser targeted at small footprint applications.
Interfacing to other parsers requires building an abstraction layer to map the common interface to the vendor's interface.
Copyright © Objective Systems 2002-2008 This document may be distributed in any form, electronic or otherwise, provided that it is distributed in its entirety and that the copyright and this notice are included. |
Objective Systems, Inc.55 Dowlin Forge RoadExton, Pennsylvania 19341 http://www.obj-sys.com Phone: (484) 875-9841 Toll-free: (877) 307-6855 (US only) Fax: (484) 875-9830 info@obj-sys.com |