About the XML to IDO Wizard
Use the XML to IDO Wizard to create SQL tables, Intelligent Data Objects (IDOs), and forms, based on XML documents. The XML documents are typically, though not necessarily, Business Object Documents (BODs). The primary intended use of this wizard is to integrate BODs with the Mongoose framework, but any XML files can be used as templates.
The XML to IDO Wizard provides functionality to select the elements or attributes of an XML document, and create tables and IDOs based on the schema of these sections. The schema information is gathered from XML XSD references, if they are available. Using this wizard, you can indicate relationships between the tables to be created; and so, any child tables include the appropriate primary and foreign key references.
You can also use the wizard to create forms to be associated with these tables and IDOs.
Optionally, for integration, replication document metadata can be created, according to the selected collections and properties in the XML file.
When an XML document is selected for conversion, the wizard automatically analyzes the XML code and parses it. If any XSD schema information is included in the XML file, and the schema locations are accurate and accessible, then the schema information (data types) can be gathered and used.
Once the XML file has been parsed and displayed, you can then interact with the code. You can:
-
Search for key words or phrases in the XML code by specifying a Search term and clicking the button.
Any matches that are found are highlighted with red text and a gray background.
- Expand and collapse all nodes by clicking the button. Expand and collapse individual nodes in the code by double-clicking the icons at the beginning of each line.
- Undock or dock the XML parser window by clicking the button. This can make viewing and working with the XML code easier.
Once you are done selecting the data you want from the XML code, the wizard proceeds to process your selections, create the replication document metadata, and create the tables, IDOs, and optional forms.
In the XML to IDO Wizard, you can define two types of data collections to be used in creating the tables and IDOs: scalar collections and table collections.
Scalar collections
A scalar collection allows you to select only single values from the XML file. Ultimately, whatever is selected must end up in a SQL table and an IDO, so with scalar values, you must first add one or more scalar collections to contain any scalar variables.
Once you create a scalar collection, you can add elements to the collection, but each element can contain only a single selected value. For this reason, you can only select elements from the XML code that have values. This also means that, if you have multiple sibling elements in the XML code, only the element that you select is defined.
Later in the process, when the tables and IDOs are created, the scalar collection becomes a table, and each element in the collection becomes a column within the table, a property within the IDO, and potentially, a component on the form.
If you require a particular element among siblings, you can add the xpath syntax to indicate the sequence; for example //Addresses/AddressLine[2], which would select the second sibling element. You can also indicate which sibling by referencing an attribute name and value, if any exist.
You can add more than one scalar collection if you want. Each collection is subsequently mapped to a particular IDO. So, if you need to insert various values from the XML file into different IDOs, you must create a collection corresponding to each of these IDOs.
Table collections
A table collection allows you to select multiple values for conversion from the XML file. You can specify selected elements in the XML as either table elements or property elements. Table elements are later converted to tables and then IDOs. Property elements are converted to table columns, IDO properties, and potentially, bound to form components.
Unlike the scalar collection, a table collection returns multiple elements that match. For example, if you select a SalesOrderLine element, and that element has ten sibling elements (that is, ten sibling SalesOrderLine elements), then the selected xpath returns all of them. Consequently, a table collection returns a table of data of varying length.
When working with table collections, you also have the ability to create primary and subcollections. Only one primary collection can be assigned, but you can add as many subcollections as you need. Keep in mind also that each collection maps to one IDO; so, if you need to distribute data across multiple IDOs, you must create a collection corresponding to each IDO.