
Restrictions
It is possible to restrict elements and attributes in an existing content model group by using the restriction element. For either elements or attributes, it is possible to exclude optional items from the derived content model. It is also possible to restrict wildcards (any or anyAttribute) to contain values of a given type. It is also possible to further restrict facets such as minOccurs and maxOccurs to specify a narrower range than was defined in the base type.
All of these restriction types are handled in the C or C++ code generated to initialize, encode, and/or decode the restricted types. The type used to hold the data is not altered - it is the original base type specified in the complexContent definition. In order to maintain compatibility with the extension logic show above, the same general form of the type is used. In the case of C, this is a struct with a base element. For C++, it is a new class derived from the base class.
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 |