
Generated Method Format and Calling Parameters
Generated encode method implementations are written to a .cpp file with a name of the following format:
where <xsdFileName> is the base name of the XSD file being parsed. For example, if code is being generated for file x.xsd, encode method implementations for each type and global element defined in the specification will be written to xEnc.cpp.
The format of the name of each generated XML encode method is encodeXML. The calling sequence is as follows:
status = <object>.encodeXML (OSCTXT* pctxt, const OSUTF8CHAR* elemName, const OSUTF8CHAR* nsPrefix);The pctxt argument is used to hold a context pointer to keep track of encode parameters. This is a basic "handle" variable that is used to make the function reentrant so it can be used in an asynchronous or threaded application. For C++, the context is obtained from the message buffer or control class object (they share a common context). The getCtxtPtr method is available in either of these classes for obtaining a pointer to the context variable.
The elemName argument is used to pass an XML element name for the type. This name is what is included in the <name> </name> brackets used to delimit an XML item. If a null pointer (0) is passed in for this argument, then no name wrapper is added to encoded XML item.
The nsPrefix argument is used to specify a namespace prefix. If this value is null or empry, no prefix is added to element name. If a prefix is given, a qualified element name of the form nsPrefix:elemName is generated.
The method result variable returns the status of the encode operation. Status code 0 (zero) indicates success. A negative value indicates encoding failed. Return status values are defined in the "rtxErrCodes.h" include file. The error text and a stack trace can be displayed using the message buffer printErrorInfo method.
Objective Systems, Inc.102 Pickering Way, Suite #506Exton, 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 |