webMethods Integration Cloud and Cloud Deployment Documentation 6.0.0 | webMethods Integration Cloud | Document Types | Creating Document Types from an XML Schema Definition
 
Creating Document Types from an XML Schema Definition
Keep the following point in mind when creating a document type from an XML Schema Definition:
*You can specify whether Integration Cloud enforces strict, lax, or no content model compliance when generating the document type. Content models provide a formal description of the structure and allowed content for a complex type. The type of compliance that you specify can affect whether Integration Cloud generates a document type from a particular XML Schema definition successfully. Currently, Integration Cloud does not support repeating model groups, nested model groups, or the any attribute. If you select strict compliance, Integration Cloud does not generate a document type from any XML schema definition that contains those items.
* To create a document type from an XML Schema definition
1. From the Integration Cloud navigation bar, click Projects > <Select a Project> > Document Types. The Document Types page appears.
From the Document Types page, you can add, edit, delete, or copy a document type.
2. To edit an existing document type, select a document type from the Document Types page and click Edit.
3. To create a new document type from an XML Schema Definition, from the Document Types page, click Add New Document Type > Build from XML schema.
4. Provide a name of your document type. Required fields are marked with an asterisk on the page.
5. On the Specify the location of the XML schema file panel, under XML schema source, do one of the following to specify the source file for the document type:
*To use an XML Schema definition that resides on the Internet as the source, select URL. Then, type the URL of the resource. (The URL you specify must begin with http: or https:.)
*To use an XML Schema definition that resides on your local file system as the source, select File. Then click Browse and select the file. The maximum file upload size is 5 MB.
6. Click Next and on the Select schema-related processing options panel, under Content model compliance, select one of the following to indicate how strictly Integration Cloud represents content models from the XML Schema definition in the resulting document type.
Select...
To...
Strict
Generate the document type only if Integration Cloud can represent the content models defined in the XML Schema definition correctly. Document type generation fails if Integration Cloud cannot accurately represent the content models in the source XML Schema definition.
Currently, Integration Cloud does not support repeating model groups, nested model groups, or any attribute. If you select strict compliance, Integration Cloud does not generate a document type from any XML schema definition that contains those items.
Lax
When possible, generate a document type that correctly represents the content models for the complex types defined in the XML schema definition. If Integration Cloud cannot correctly represent the content model in the XML Schema definition in the resulting document type, Integration Cloud generates the document type using a compliance mode of None.
When you select lax compliance, Integration Cloud will generate the document type even if the content models in the XML schema definition cannot be represented correctly.
None
Generate a document type that does not necessarily represent or maintain the content models in the source XML Schema definition.
7. If you select strict or lax compliance, next to Preserve text position, do one of the following to specify whether document types generated will contain multiple *body fields to preserve the location of text in instance documents.
*Select the Preserve text position check box to indicate that the document type generated preserves the locations for text in instance documents. The resulting document type contains a *body field after each field and includes a leading *body field. In instance documents for this document type, Integration Cloud places text that appears after a field in the *body.
*Clear the Preserve text position check box to indicate that the document type generated does not preserve the locations for text in instance documents. The resulting document type contains a single *body field at the top of the document type. In instance documents for this document type, text data around fields is all placed in the same *body field.
8. If you want Integration Cloud to use the Xerces parser to validate the XML Schema definition, select the Validate schema using Xerces check box.
Note: Integration Cloud automatically uses an internal schema parser to validate the XML Schema definition. However, the Xerces parser provides stricter validation than the internal schema parser. As a result, some schemas that the internal schema parser considers to be valid might be considered invalid by the Xerces parser.
9. Click Next and on the Select root nodes panel, under Select root nodes, select the elements that you want to use as the root elements for the document type. The resulting document type will contain all of the selected root elements as top-level fields in the generated document type. To select multiple elements, press the CTRL key while selecting elements.
10. Click Finish.
Integration Cloud creates the document type.
Notes
*If you have selected strict compliance and Integration Cloud cannot represent the content model in the complex type accurately, Integration Cloud does not generate any document type.
*If you have selected lax compliance and indicated that Integration Cloud should preserve text locations for content types that allow mixed content (you selected the Preserve text position check box), Integration Cloud adds *body fields in the document type only if the complex type allows mixed content and Integration Cloud can correctly represent the content model declared in the complex type definition. If Integration Cloud cannot represent the content model in a document type, Integration Cloud adds a single *body field to the document type.
*If the XML schema definition contains an element reference to an element declaration whose type is a named complex type definition (as opposed to an anonymous complex type definition), Integration Cloud creates a document type for the named complex type definition only if it is referred multiple times in the schema.
*Integration Cloud uses the prefixes declared in the XML Schema or the ones you specified as part of the field names. Field names have the format prefix:elementName or prefix:@attributeName.
*If the XML Schema does not use prefixes, Integration Cloud creates prefixes for each unique namespace and uses those prefixes in the field names. Integration Cloud uses “ns” as the prefix for the first namespace, “ns1” for the second namespace, “ns2”.
*If the XML Schema definition contains a user-specified namespace prefix and a default namespace declaration, both pointing to the same namespace URI, Integration Cloud uses the user-specified namespace prefix and not the default namespace.
*If the namespace prefix in the XML Schema as well as the default namespace point to the same namespace URI, Integration Cloud gives preference to the user-specified namespace prefix over the default namespace.

Copyright © 2014- 2019 | Software AG, Darmstadt, Germany and/or Software AG USA, Inc., Reston, VA, USA, and/or its subsidiaries and/or its affiliates and/or their licensors.