Specifying a Target Structure

There are two ways to specify an XQuery target structure:

  • 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.
  • 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:

For more information

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.

Figure 241. Name Dialog Box

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.

Note

 

You can create elements and attributes in a new or existing target structure.

How to tcreate elements and attributes
To create elements and attributes:
1. Click the Mapper tab if necessary.
2. Select the attribute or element to which you want to add a child element or attribute. If you have just created a root element, select the root element.
3. Right click the area underneath the Set Target Document button.

The target document shortcut menu appears.

4. Choose one of the following:
    • Add Attribute
    • Add Child Element
    • Insert Element After (This choice is not applicable to the root element; it creates the element as a sibling of the selected element.)
    • The Name dialog box appears.

      Figure 242. Name Dialog Box

5. Type a name for the node and click OK.

The node you specified is added to the target structure in the Mapper tab.

Scientific, Photo & Control Equipment

Scientific, photo & control equipment companies hear clicks and beeps all day. But, when it comes to data integration it needs to be done in a flash, that's why they use Stylus Studio. Come see which top companies are seeing XML in a brand new light!

XML to PDF

Convert XML to PDF using Stylus Studio's XML publishing tools - the easiest way to design beautiful document layouts for use in XSL:FO based multi-channel publishing and single source publishing applications.

Medical Companies That Use Stylus Studio

Medical companies can't solve every ache and pain. That's why when it comes to the struggle of data integration, they turn to Stylus Studio to simplify their pains. Come see which medical companies are injecting Stylus Studio into their work load!

Text File to XML

Stylus Studio provides several easy-to-use document wizards that allow you to quickly convert text files to XML. Create XML from text and EDI, create XML Schema from EDIFACT, and more!

Stylus Most Wanted

 
Free Stylus Studio XML Training:
W3C Member