<schemaBindings> Declaration

The customization values in <schemaBindings> binding declarations have schema scope. These apply to all elements within the referenced XML schema document.

Usage

   <schemaBindings namespace | schemaLocation=”xs:anyURI”>
          [<prefix>xs:token</prefix>]
          [<sourceFile>xs:anyURI</sourceFile>]
          [<nameXmlTransform>. . .</nameXmlTransform>]
          [<doubleFormat/>]
          [<decimalFormat/>]
          [<floatFormat/>]
          [<nodeBindings>. . .</nodeBindings>]
          [<typemap>. . .</typemap>]
          [<cppNamespace>. . .</cppNamespace>]
          ...
   </schemaBindings>

The following attributes are defined for <schemaBindings> node:

namespace: A URI reference to a schema’s target namespace. The processor will look at the target namespace in all of the schemas currently being compiled for a match with the given namespace. When an XSD document without a targetNamespace is included into an XSD document with a targetNamespace, it takes on the including document's targetNamespace. This fact is taken into account.
schemaLocation: URL as it is used in <xsd:import> or <xsd:include> statements. When this alternative is used, <sourceFile> should be provided, to map the schema URL to an actual schema file. No other child elements should be present. To specify other options, use an <schemaBindings> element with a namespace attribute. XBinder does not have the capability to automatically reference schemas remotely; therefore, any imported or included schemas must have been downloaded in advance and be present on the user’s computer.

The following customization values are defined in schema scope:

prefix: This is used to specify a prefix that is prepended to all XML names including type names and global element names to form C/C++ type and variables names. It should be a legal C/C++ identifier.
sourceFile: The actual schema file path. XBinder does not have the capability to automatically reference schemas remotely; therefore, any imported or included schemas must have been downloaded in advance and be present on the user’s computer. This element is used to map a schema URL to a file on the local system.
nameXmlTransform: This is used to perform more accurate XML names transformation than prefix allows. See Section “Advanced XML Names Transformation” for further details.
doubleFormat: This specifies a schema-level format for encoding of values of “double“ type. See Section “XML Numeric Values Format Specification”.
decimalFormat: This specifies a schema-level format for encoding of values of “decimal“ type See Section “XML Numeric Values Format Specification”.
floatFormat: This specifies a schema-level format for encoding of values of “float“ type. See Section “XML Numeric Values Format Specification”.
nodeBindings: Node scope binding declarations (see Section “<nodeBindings> Declaration”). This element can be specified multiple times, but only once per definition.
typemap: This specifies a default (global) mapping of a specific XSD type to a C type (see Section “<typemap> Declaration”). It can be specified multiple times. In each typemap declaration, a list of XSD types separated by space can be mapped to one C type.
cppNamespace: This specifies the C++ namespace to use in generated code. This option only takes effect when the -cppNs command line option is used. The namespace given using -cppNs will serve as a default C++ namespace that is overridden for particular schema components using this configuration option.