Scenario Properties General Tab (XQuery)

A scenario allows you to preview the results of an XQuery. You use the General tab of the Scenario Properties dialog box to specify, optionally, the XML you want to query (you can write an XQuery that does not perform any operations on an XML document) and the URL to which you want to output the query result.

You can choose as input existing XML documents, or XML documents that Stylus Studio creates on-the-fly, based on a table in a relational database or a flat file (like EDI) converted to XML, for example.

You can display the XQuery Scenario Properties dialog box by clicking Browse next to the scenario name field in the XQuery Editor (in either XQuery Source or Mapper tabs).

Fields

Existing Scenarios

Lists the scenarios that have already been defined for the current XQuery. To view the settings for a different scenario, click the name of that scenario.

Main Input (optional)

The XML against which you want to run the XQuery. This can be an existing XML document, or an XML document Stylus Studio creates on the fly using an XMl conversion to convert a text file, like EDI, to XML. See Other Ways to Convert Files to XML for more information.

Output URL (optional)

Optionally specify or select an absolute path for the file that contains the result of the XQuery preview. Each time you click Preview Result to run the XQuery, Stylus Studio automatically updates the contents of this file, and it also displays the result in the Preview window. If you specify an output a file that does not exist, Stylus Studio creates it.

Use Relative Paths

Allows you to specify input and output files using paths that are relative to the XQuery. If you plan to move the XQuery to a different directory than the one to which you save it during development, consider disregarding this option and using absolute paths to specify input and output files.

Preview Result in an External Application

By default, XQuery results are displayed in the Preview window. You can use this option to also display the result in the default application for the output method specified for the XQuery. For example, if the output method for the scenario is HTML Stylus Studio displays the resulting HTML in a web browser like Internet Explorer, as well as in the Preview window.

Buttons

Add creates a new scenario.

Clone copies the selected scenario with a new name.

Delete removes the selected scenario.

Rename renames the selected scenario.

Browse the file system to select the source XML document.

For More Information

Creating an XQuery Scenario

Getting Started with XQuery in Stylus Studio

Building an XQuery Using the Mapper

 
Free Stylus Studio XML Training: