Home >Online Product Documentation >Table of Contents >Configuring Data Sources
The source for the information required for the desired report comes from two files:
booksXML.txt
order.edi
Neither of these files provides data in XML format, so they will have to be converted to XML. We will use built-in DataDirect XML Converters for this task.
You use ConvertToXML nodes to specify a non-XML data source in an XML pipeline. There are two ways to do this:
While both require a similar number of steps, converting a source file can be more economical as it creates a resource that you can reuse in the XML pipeline, and elswhere in Stylus Studio. Both procedures are described in the following sections.
The Open dialog box appears.
examples\pipeline\order
All Files
Stylus Studio displays the Select XML Converter dialog box.
The booksXML.txt source file happens to use a vertical bar (|) as its separator character.
To view the source .txt and .edi files, double-click them in the Project window to display them in a Stylus Studio editor.
.txt
.edi
The booksXML.txt file appears in the Other Documents folder in the Project window. If you hover the mouse pointer over the file name, you will see the full specification of the XML Converter URL used to convert it.
Stylus Studio creates a ConvertToXML node with its input port already specified.
Stylus Studio creates a ConvertToXML node and displays it in the XML pipeline diagram.
The properties for the input port are displayed in the Properties window.
Stylus Studio displays the Default Value dialog box.
examples\pipelines\order\
The input port on the ConvertToXML Node turns green, indicating that a source document has been specified as the input.
Next, we need to specify which built-in converter to use to convert booksXML.txt to XML.
The ConvertToXML node representing the conversion of the booksXML.txt file to XML is now completely specified, except for the output. We will address that in the section Setting the XQuery Node Data Sources.
Next, using the procedure described in either Convert booksXML.txt Using a Built-in XML Converter or Create a ConvertToXML Node for booksXML.txt, create a ConvertToXML node for the order.edi file. Note the following changes:
When you add a second node of the same type using the Toolbox, Stylus Studio gives the second node the same name as the first, with a number to make it unique. If you create a node by dragging a document and dropping it on the canvas, Stylus Studio gives the node the same name as the file.
Depending on how you created the ConvertToXML nodes in the XML pipeline, they are named either:
You can reame nodes using the following procedure:
Node names are displayed as tooltips in the XML pipeline diagram when you hover the pointer over the node. You can also create labels for the diagram and for nodes within the diagram. See <xHyperlink>Labeling for more information.
At this point, we have defined the converters to be used to convert our non-XML data sources to XML. The resulting XML pipeline, myOrders.pipeline, looks something like this:
myOrders.pipeline
In the next stage of the process, we will specify the XQuery file that we will use to join the data from these two files.