XML-Based Adapters

In this section:

This section describes new features for XML-based adapters.


Top of page

x
Adapter for XML: Improved Processing of Large Schemas or DTDs

How to:

When creating a synonym from a large schema or DTD, you can use a subset instead of the entire file.



x
Syntax: How to Create Synonyms From Schema or DTD Subsets

If you want to create a synomyn from a large XML schema or DTD, you can improve performance by using a subset based on a given position in the hierarchy. This creates a smaller synonym from a subtree (child element) of the XML root.

The syntax is:

CREATE SYNONYM child_element FOR schema.xsd  
DBMS XML 
AT app_dir 
PARMS POSITION=/parent_element/child_element  
DROP
END

where:

child_element

Is the subtree from which the synonym is created.

schema.xsd

Is the schema on which the synonym is based.

app_dir

Is the application directory where the synonym is created.

PARMS POSITION

Indicates the position in the schema hierarchy.

parent_element

Is the parent element located at the top-level of the schema hierarchy.

In the following example, the synomyn is created for the chapter subtree. The chapter is a child of the book element, which is located at the top-level of the xmlbook schema hierarchy:

CREATE SYNONYM chapter FOR xmlbook.xsd 
DBMS XML 
AT baseapp 
PARMS POSITION=/book/chapter
DROP
END

XPATH=/book is added to the Access File to indicate the position of chapter (the root segment in the synonym) in the schema hierarchy.

When issuing TABLE requests or writing XML based on the synonym, the actual path of the node is required. Since chapter is not the root node in the original schema, the path from the top of the schema to chapter is /book/chapter.

When writing XML files based on the synonym, the chapter element will be wrapped inside the book element, as in <book><chapter>...</chapter></book>.

When reporting on an XML file based on the synonym, you should overlook book since chapter is right under book.


WebFOCUS