TOC PREV NEXT INDEX


Generated C++ Method Format for XSD Types


Implementations of C++ pull-parser based decode methods are written to a .cpp file with a name of the following format:

<xsdFileName>Dec.cpp

where <xsdFileName> is the base name of the XSD file being parsed. For example, if code is being generated for file x.xsd, decode methods for each type and global element defined in the specification will be written to xDec.cpp.
The format of the name of each generated XML decode method is decodeXML. The calling sequence is as follows:

    stat = <object>.decodeXML (OSCTXT* pctxt);

In this definition, <object> denotes an object instance of the generated class.
The pctxt argument is the underlying context to the decode message buffer or stream object. It can be obtained by calling the getCtxtPtr method.
The function result variable stat returns the status of the decode operation. Status code 0 (zero) indicates the function was successful. A negative value indicates decoding failed. Return status values are defined in the rtxErrCodes.h include file. The error text and a stack trace can be displayed using the rtxErrPrint function.
A key difference between SAX-based functions and pull-parser based is that a decode function is not generated for all types in the SAX case. That is because of the overhead invlolved in setting up the SAX parser to decode simple types. Most simple types are decoded inline as part of more complex types. This is an example of a case where the pull-parser model more closely follows the encode model.

Copyright © Objective Systems 2002-2007
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 Road
Exton, 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

TOC PREV NEXT INDEX