23.1. XML Schema Design Considerations

When creating an XML schema document that contains list or union elements whose XML instances will be stored in a relational database (in non-XML form), the XML schema designer needs to consider the effect of design decisions on the database representation. In addition, certain decisions need to be made explicitly that would not normally affect an XML schema document. This section lists the major considerations and provides recommendations and discussion around each of them.

23.1.1. list Element Design Considerations

When using the list element, determine if the items in the list need to be stored separately in a relational database or can be maintained in a single string. Will the members of the list be accessed or updated separately? Will reports be run that need to count or reference the individual items in the list? If the answer is no, a single string may suffice. Document the intended use of the list element in the annotation.

Maintaining a length constraining facet or a minLength constraining facet is nontrivial in the database. Determine if these are needed and, if so, whether the database needs to enforce these constraining facets.

23.1.2. union Element Design Considerations

From a database design perspective, unions should be avoided, if possible, due to their design and implementation complexity. If the union is, for example, a union of lists, a union of IDREFS, or a union of NMTOKENS, the database schema to support these is complex.

If a union element is required, determine if the item of the union needs to be stored in separate columns in a relational database (by memberType) or can be maintained in a single string. Will reports be run that need to count or reference the item of the union by type? If the answer is no, a single string may suffice. Document the intended use of the union element in the annotation.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.145.93.221