Chapter 6 Exchanging data with databases supporting XML
If you want to modify or reinforce the mapping resulting from the XML Builder Wizard, you can define extended attributes for XML objects. Extended attributes are available from the Microsoft SQL Server extended model definition attached to the mapped XML model. If the element and attribute names match with the table and column names, you do not need to define extended attributes for XML objects.
You could generate an annotated schema without a PDM and the XML Builder Wizard, only through extended attributes, but it would not be the easiest way to proceed.
Caution
The following procedure assumes you have an XML model open in the workspace, targeted with XSD or XDR, mapped with a PDM, and linked to the Microsoft SQL Server extended model definition. (See Mapping XML objects to PDM objects)
To generate an annotated schema by reinforcing mapping with extended attributes:
Annotation | E | A | Description |
---|---|---|---|
encode | When an XML element or attribute is mapped to a SQL Server BLOB column, allows requesting a reference (URI) to be returned and used later to return BLOB data | ||
field | Maps an XML item to a database column | ||
hide | Hides the element or attribute specified in the schema in the resulting XML document | ||
is-constant | — | Creates an XML element that does not map to any table. The element is displayed in the query output | |
key-fields | — | Allows specification of columns that uniquely identify the rows in a table | |
limit-field | Allows limiting the values that are returned on the basis of a limiting value | ||
limit-value | Allows limiting the values that are returned on the basis of a limiting value | ||
mapped | Allows schema items to be excluded from the result | ||
max-depth | — | Allows you to specify depth in recursive relationships that are specified in the schema | |
overflow-field | — | Identifies the database column that contains the overflow data | |
relation | — | Maps an XML item to a database table | |
relationship-child | — | Specifies an element as the child table in a reference (To define only in the child element property sheet) | |
relationship-child-key | — | Specifies an attribute as the foreign key of a child table in a reference (To define only in the child element property sheet) | |
relationship-parent | — | Specifies an element as the parent table in a reference (To define only in the child element property sheet) | |
relationship-parent-key | — | Specifies an attribute as the primary key of a parent table in a reference (To define only in the child element property sheet) | |
use-cdata | — | Allows specifying CDATA sections to be used for certain elements in the XML document | |
prefix | — | Creates valid XML ID, IDREF, and IDREFS. Prepends the values of ID, IDREF, and IDREFS with a string |
Copyright (C) 2007. Sybase Inc. All rights reserved. |
![]() |