|
Home >Online Product Documentation >Table of Contents >XQuery Editor - Mapper Tab XQuery Editor - Mapper Tab
The XQuery mapper allows you to construct an XQuery graphically, without writing any code, by mapping elements from one or more source documents to a target structure. Stylus Studio uses these source/target mappings to define an XQuery that returns a document that conforms to the target structure you build. Nodes on the target structure can be inferred from an existing document, or you can create them (either from scratch or by copying source document nodes to the target structure).
How to Map
To map a source document node to an existing target structure node, drag and drop the source element using the left mouse button. To use a source document node to create a new node on the target structure, drag and drop the source element using the right mouse button and select one of the following operations from the shortcut menu:
l Add Attribute and Map It
l Add Child Element and Map It
l Insert Element After and Map It
l Copy Node
Fields
Create Scenario
A scenario allows you to preview the results of applying an XQuery. Scenario settings include the name of an XML source document, the values of any parameters in the XQuery script, and the type of performance metrics you want Stylus Studio to capture, if any. XQuery scenarios are optional.
To create a scenario, click ![]()
Click the down arrow to select a previously defined scenario. Click Preview Result ![]() Source file name
Click here to change the name of the source XML document you want to use to perform the mapping. When the mapping is complete, you will have a stylesheet that you can apply to documents that have the same schema as this document.
Destination file name
Click here to change the name of the target XML document you want to use to perform the mapping. When the mapping is complete, you will have a stylesheet that generates XML documents that have the same schema as this document.
Buttons
Add Source Schema displays the Open dialog box and lets you select a source document for the XQuery mapper. Stylus Studio uses the first document you select as the default source XML for the scenario. You can use multiple sources in the XQuery mapper. Set Target Schema displays the Open dialog box so you can select a target document for the XQuery mapper. You can create a target document from scratch - right click in the Set Target Schema canvas and select Create Root Element.
For More Information
Building an XQuery Using the Mapper |