Rogue Wave banner
Previous fileTop of DocumentContentsIndex pageNext file
XML Binding Development Guide
Rogue Wave web site:  Home Page  |  Main Documentation Page

7.5 Working with Unsupported Complex Types

If your applications use complex types unsupported by LEIF, you can map them to a supported complex type using the LEIF project file. An example of an unsupported type might be a complex type that derives by restriction, and results in changing the types it holds.

When LEIF encounters an unsupported type during code generation, it will generally, but not always, issue a warning, such as "WARNING: Mixed content type not supported." If your generated code does not compile, see the XML Binding readme in your installdir\docs\readmes\xmlbinding directory for a list of unsupported features.

You have two options for mapping your unsupported complex types. You can map them to the XML Schema type anyType or to some other complex type of your own design.

For instance, you may have an existing unsupported type in your application that cannot be changed, but could be mapped to an equivalent, supported complex type. In this case, you would include the schema definition for the new complex type in your project directory before generating code, and map to it in the LEIF project file.

Alternatively, your unsupported type may have no reasonable equivalent type. In this case, you may map it to anyType.

For example, the following element MyComplexType contains one attribute and a nested complex type UnsupportedType, unsupported by LEIF:

You can map this type to anyType using the <mappings> element in the LEIF project file:

For complex types mapped to anyType, LEIF marshals the element into a stream that includes the root element and any defined namespaces. You can then parse the string using the parser of your choice. If you wish to use the LEIF parser LEIF::XmlReader, see the examples under its class entry in the LEIF Library Reference Guide.



Previous fileTop of DocumentContentsIndex pageNext file

©2003-2005 Copyright Quovadx, Inc. All Rights Reserved.
Rogue Wave is a registered trademark of Quovadx, Inc. in the United States and other countries. All other trademarks are the property of their respective owners.
Contact Rogue Wave about documentation or support issues.