SELECT.XSLT
Selects content from one or more sources containing either Xml-format or the neutral Table-format by using an Xslt-script. The output will be Xml.
Properties
From | Name of the "Primary" Input Data Source.The input-source can contain either a file-path, a PBinaryStream object or a .Net Stream object. A Stream object can only be specified programmatically. Note: Instead of a name of a source, a period '.' can be entered. This means that no "Primary" data source is specified. This may be the preferred way, in those cases where you need to interact with multiple data-sources, so that it is clearer that it depends on more than 1 data-source. |
To | Name of the Output Data Source. |
Script | The Xslt script code used to process the input source. The Xslt script is allowed to contain c# code. The script-code can also be defined dynamically by including parameter references. The parameter values are evaluated in the same way as the script method { 9.16 Method: FillTemplate ( … ) }. |
Xslt Guide
This Command is very powerful for the construction of any Xml structure, as the Xslt-script allows you to produce any desired structure. Furthermore, in Actions it has been implemented such that the Xslt-script has access to all the data sources on the Data Sources stack. Since you can pull data very easily from almost everywhere to the stack, this means you can create pretty much anything you like with the data.
Scripts are enabled, such that you are allowed to e.g. use c# scripting directly inside you Xslt-script, to create your own methods to handle e.g. data formatting, or more complex things that can otherwise be cumbersome to do with pure Xslt-script.
Example Using multiple data-sources
This example shows you several of the techniques you can use to access data from multiple sources on the Actions stack of data sources and combine them freely into a completely new Xml structure.
Input Data Sources
The example assumes the following 3 data sources have been loaded onto the data-stack.
Data Source 1 – Named ‘PRODUCTS’
Shown below in Xml-format, but it may as well be loaded in the Table-format (e.g. from an Excel sheet by use of the SELECT.EXCEL Command).
<root>
      <Product id="101">
             <SKU>AudiA4</SKU>
             <Title>Audi A4 Limousine</Title>
             <Manufacturer>Audi</Manufacturer>
      </Product>
      <Product id="102">
             <SKU>AudiA6</SKU>
             <Title>Audi A6 Avant</Title>
             <Manufacturer>Audi</Manufacturer>
      </Product>
      <Product id="103">
             <SKU>VolvoXC70</SKU>
             <Title>Volvo XC70 Wagon</Title>
             <Manufacturer>Volvo</Manufacturer>
      </Product>
</root>
Data Source 2 – Named ‘MANUFACTURERS’
Shown below in Xml-format, but it may as well be loaded in the Table-format (e.g. from an Excel sheet by use of the SELECT.EXCEL Command).
<root>
      <Manufacturer>
             <Name>Audi</Name>
             <Country>Germany</Country>
             <Types>Cars</Types>
             <Founded>1909</Founded>
      </Manufacturer>
      <Manufacturer>
             <Name>Volvo</Name>
             <Country>Sweden</Country>
             <Types>Cars</Types>
             <Founded>1927</Founded>
      </Manufacturer>
</root>
Data Source 3 – Named ‘COUNTRIES’
Shown below in Xml-format, but it may as well be loaded in the Table-format (e.g. from an Excel sheet by use of the SELECT.EXCEL Command).
<Data>
      <Country>
             <Name>Germany</Name>
             <Continent>Europe</Continent>
             <Size>Large</Size>
      </Country>
      <Country>
             <Name>Denmark</Name>
             <Continent>Europe</Continent>
             <Size>Even Smaller</Size>
      </Country>
      <Country>
             <Name>Sweden</Name>
             <Continent>Europe</Continent>
             <Size>Small</Size>
      </Country>
</Data>
The Xslt-script
An example Xslt-script is shown below. It uses all of the above 3 data sources and combines them into another Xml-structure.
The Output result
The output-result of applying the above Xslt-script to the above 3 input-sources is shown below.
Â