Specifying a Target Structure

There are two ways to specify an XQuery target structure:

l You can select an existing document from which Stylus Studio infers a structure and, optionally, modify the structure. Existing nodes in a target structure are displayed in blue. Nodes that you add are displayed in red. If a node is required by the associated XML Schema or DTD, a red check appears over the node symbol.
l You can build a structure from scratch, starting with the root element and defining other elements and attributes as needed. Nodes for target structures you define are displayed in red.

This section covers the following topics:

See Modifying the Target Structure to learn about the types of changes you can make to a target structure.

Using an Existing Document

To use an existing document to provide the XQuery target structure:
1. Click the Mapper tab if necessary.
2. Click the Set Target Document button at the top left of the Mapper tab.
The Open dialog box appears.
3. Select the document you want to use to provide the target structure for defining the XQuery.
4. Click Open.
The structure of the document you select appears in the target document pane of the Mapper tab.

Building a Target Structure

To build a target structure from scratch, you first create a root element, and then define child elements and attributes as needed.

How to create a root element
To create a root element:
1. Click the Mapper tab if necessary.
2. Right click the area underneath the Set Target Document button.
The target document shortcut menu appears.
3. Select Create Root Element.
The Name dialog box appears.
4. Type a name for the root element and click OK.
The root element you specified appears in the target document pane of the Mapper tab.
 
Free Stylus Studio XML Training:
W3C Member