Chapter 9 Generating Other Models from a PDM
In the XML Hierarchy Design page, you build the structure of the generated XML model.
The XML structure starts with the predefined Root element to which all first generation elements should be linked, if you want your XML structure to be strictly valid. For internal use, you can delete the Root element and start the XML structure from the Elements folder.
If you click the Element radio button, columns are created as elements, otherwise they are created as attributes.
To create the XML hierarchy you have to click a table name and drag and drop it to the Root or to an element folder in the right-hand pane. You can also click the target element in the right-hand pane, right-click a table name in the left pane and select Add in the contextual menu.
If you chose to create columns as attributes, an element with the table name appears in the right-hand pane with an attribute for each column. If you chose to create columns as elements, elements corresponding to the columns are created under the table element. The child table appears as a child element linked to its parent element via a sequence group particle.
Caution
You cannot create an XML hierarchy between two elements if there is no reference between their corresponding tables.
The XML hierarchy respects the PDM hierarchy: A parent table cannot be the child element of an element corresponding to a child table.
You can use the following tools to build the hierarchy:
Tool | Description |
---|---|
![]() |
Adds the selected object in the left-hand pane to the selected item in the XML hierarchy. |
![]() |
Creates a default hierarchy for the selected category (for example when the Tables category is selected). This tool is also available when you no category or object is selected in the right-hand tree, it then creates the entire XML hierarchy. |
You can create a group particle from a parent element in the right-hand pane using the New→Sequence (Choice or All) commands in the element's contextual menu.
The following actions are available in the XML Hierarchy Design page of the wizard:
Action | Description |
---|---|
Open tables and columns property sheets | Double-click or right-click a table or a column name and select Properties in the contextual menu |
Rename elements or attributes | Click an element or an attribute name and type a new name |
Add new elements or attributes without mapping | Right-click the Elements folder or an Attributes folder and select New in the contextual menu. Right-click a group particle and select New→Element (Sequence, Choice or All) in the contextual menu |
Delete elements, attributes or group particles | Right-click an element name, an attribute name or folder, a group particle name and select Delete in the contextual menu |
When you click Finish, the new XML model appears in the diagram window and the Browser tree view (not expanded). Expand the model in the Browser tree view to reveal all its generated elements and attributes (or child elements).
In the case of an existing XML model, the generated elements appear next to the existing elements.
The XML Builder Wizard attaches the SQL/XML extended model definition to the new or existing XML model to generate SQL/XML queries from global elements. (See next section)
Copyright (C) 2005. Sybase Inc. All rights reserved. |
![]() |