Rogue Wave banner
Previous fileTop of DocumentContentsIndex pageNext file
HydraExpress XML Binding Development Guide

4.1 Purpose and Overview

This example illustrates the more advanced concepts of namespace qualification and collection support in HydraExpress. This example expands on the basic Purchase Order example and illustrates how namespace qualification affects usage of the generated classes. The example also illustrates how to use the collection support provided by HydraExpress for schemas that have element declarations with the maxOccurs attribute set to a value greater than one, or set to unbounded.


The example program in this chapter uses SourcePro C++ classes.

4.1.1 The XML Schema

The XML Schema below describes the purchase order. Like the basic Purchase Order example, this example is taken from the XML Schema Part 0: Primer document, section 3. The structure of this schema is identical to the structure for that of the basic example; note, however, that the targetNamespace attribute is defined on the schema element and that the elementFormDefault attribute is set to qualified. This means that all elements in an instance document of this schema are namespace-qualified.

4.1.2 The XML Document

The XML below shows a portion of the example purchase order taken from section 3 in XML Schema Part 0: Primer. This XML document conforms to the namespace qualification rules defined in the previous schema. Note that all elements in the document are in the namespace "http://www.example.com/PO1". The top-level element apo:purchaseOrder declares that the prefix apo corresponds to the namespace "http://www.example.com/PO1". Each element in the document has the prefix apo, therefore each element is within the namespace "http://www.example.com/PO1".



Previous fileTop of DocumentContentsNo linkNext file

Copyright © Rogue Wave Software, Inc. All Rights Reserved.

The Rogue Wave name and logo are registered trademarks of Rogue Wave Software, and HydraExpress is a trademark of Rogue Wave Software. All other trademarks are the property of their respective owners.
Provide feedback to Rogue Wave about its documentation.