Show TOC

Customizing XSM Generation for Individual ObjectsLocate this document in the navigation structure

When generating an XSM from a PDM or OOM, you can specify global generation options to generate tables/classes as elements with or without complex types and columns/attributes as elements or attributes. You can override these options for individual objects by attaching the PDM XML Generation or OOM XML Generation extension to your source model and selecting from their XML generation options.

Context

Note The extension provides new property sheet tabs for setting generation options for individual objects, but you can also set these options with or without the extension by selecting Start of the navigation path Model Next navigation step <objects> End of the navigation path to open the appropriate object list, clicking the Customize Columns and Filter tool, and selecting to display the XML Generation Mode column.
For example, if you want to generate the majority of your table columns to an XSM as XML attributes, but want to generate certain columns as elements, you should:
  • Modify the XML generation options for those columns that you want to generate as elements.
  • Select to generate columns as attributes on the Model Generation Options Detail tab.

Procedure

  1. Select Start of the navigation path Model Next navigation step Extensions End of the navigation path to open the List of Extensions, and click the Attach an Extension tool.
  2. On the General Purpose tab, select PDM XML Generation or OOM XML Generation and click OK to attach the extension to your model and OK to close the List of Extensions.
    These extension files enable the display of the XML tab in all table and column or class and attribute property sheets.
  3. Open the property sheet of the table, column, class, or attribute whose generation you want to customize, and click the XML tab.
  4. Use the radio buttons to specify how you want to generate the object in an XSM.
    • For tables and classes, you can specify to generate them as:
      • Elements - the table/class is generated as an untyped element directly linked to its columns/attributes generated as attributes or sub-elements.
      • Elements with complex types - the table/class is generated as an element typed by a complex type, generated in parallel, to contain the columns/attributes.
      • Default - generation of the table/class is controlled by the option selected in the XML Generation group box on the Model Generation Options Detail tab.
    • For tables, you can additionally specify to generate keys as:
      • Key - [default] The primary key columns are generated and also KEY and KEYREF wherever the table is referenced.
      • ID attribute - The primary key columns are not generated and an ID attribute, id,  is generated to replace them. Wherever the table is referenced, an IDREF attribute is generated to reference the appropriate element. If the reference role name is assigned, this attribute is given this name. Otherwise, the referenced table name is used and the standard renaming mechanism is enforced.
      • Key and ID attribute - In many cases the primary key columns have significant data and you may want to generate them, as well as an ID attribute. In this case an ID attribute is generated for the element and IDREF is  used systematically for any reference to the table:
      The following rules apply to the generation of keys:
      • If a Table generates an ID, all its child tables will generate an ID attribute.
      • If a Table generates Key columns, all its child tables will generate Key columns.
      • If a child table is flagged to generate PK only, ID Attribute will be automatically generated.
      • If a table generates ID attribute, No Key nor KeyRef will be generated, and ALL references will generate IDREF attribute.. (Even if the table generates also Key Columns)
      • If a table generates ID attribute ONLY, All Foreign Key Columns referencing its Key columns will be systematically removed and replaced by an IDREF attribute
    • For columns and attributes, you can specify to generate them as:
      • Elements - [default] the column/attribute is generated as an sub-element of its table/class element or complex type.
      • Attributes - the column/attribute is generated as an attribute of its table/class element or complex type.
      • Default - generation of the column/attribute is controlled by the option selected in the XML Generation group box on the Model Generation Options Detail tab.
  5. Modify the XML generation options for any other objects that you want to generate in a different manner.
  6. Select Start of the navigation path Tools Next navigation step Generate XML Model End of the navigation path, ensure that the appropriate options are set in the XML Generation group box on the Model Generation Options Detail tab, and start your generation.