diff options
Diffstat (limited to 'examples/cxx/hybrid/custom/wildcard/README')
-rw-r--r-- | examples/cxx/hybrid/custom/wildcard/README | 83 |
1 files changed, 83 insertions, 0 deletions
diff --git a/examples/cxx/hybrid/custom/wildcard/README b/examples/cxx/hybrid/custom/wildcard/README new file mode 100644 index 0000000..e8ef1b8 --- /dev/null +++ b/examples/cxx/hybrid/custom/wildcard/README @@ -0,0 +1,83 @@ +This example shows how to parse, store in the object model, and serialize +XML data matched by XML Schema wildcards (any and anyAttribute) using the +Embedded C++/Hybrid. + +This example uses the object model as well as parser and serializer +customization mechanisms provided by the C++/Hybrid mapping. For more +information, see Section 4.8, "Customizing the Object Model" and Section +6.1, "Customizing Parsers and Serializers" in the Embedded C++/Hybrid +Mapping Getting Started Guide. + +The example consists of the following files: + +email.xsd + XML Schema which describes a simple email format with the + extensible envelope type. + +email.xml + Sample email message. + +email.hxx +email.cxx + +email-pskel.hxx +email-pskel.cxx +email-pimpl.hxx +email-pimpl.cxx + +email-pskel.hxx +email-pskel.cxx +email-pimpl.hxx +email-pimpl.cxx + Object model (the first pair of files), parser skeletons (the + second pair), parser implementations (the third pair), serializer + skeletons (the fourth pair), and serializer implementations (the + fifth pair). These files are generated by the XSD/e compiler from + email.xsd. The --generate-parser, --generate-serializer, and + --generate-aggregate options were used to request the generation of + the parsing and serialization code. The --custom-type option was + used to customize the the envelope class in the object model. The + --custom-parser option was used to customize the envelope_pimpl + parser implementation. The --custom-serializer option was used to + customize the envelope_simpl serializer implementation. Finally, + the --hxx-epilogue option was used to include body.hxx (see below) + at the end of the generated object model header file. + +body.hxx +body.cxx + Implementation of the body class. It is used to store the wildcard + data in the body sequence of the customized envelope class. + +envelope.hxx +envelope.cxx + Custom envelope type. It uses the generated version as a base and + adds a data member as well as accessor and modifier functions for + the wildcard content. + +envelope-pimpl.hxx +envelope-pimpl.cxx + Custom envelope parser implementation. It uses the implementation + generated by the XSD/e compiler as a base and overrides the wildcard + callbacks to parse the wildcard content and store in the body sequence + of the customized envelope object. + +envelope-simpl.hxx +envelope-simpl.cxx + Custom envelope serializer implementation. It uses the implementation + generated by the XSD/e compiler as a base and overrides the wildcard + callbacks to serialize the wildcard content stored in the body sequence + of the customized envelope object. + +driver.cxx + Driver for the example. It first calls the parser that constructs the + email object from the input XML file. It then prints the content of + the email to STDERR. Finally, the driver creates a reply email and + calls the serializer to serialize it to XML. + +To run the example on the sample XML instance document simply execute: + +$ ./driver email.xml + +The example reads from STDIN if input file is not specified: + +$ ./driver <email.xml |