SELECT.XML
Selects content from a source containing Xml-format.
Properties
From | Name of the 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. |
To | Name of the Output Data Source. |
Parameters
@Context | Specifies in which context to find data in the Xml document. Examples:
Hint |
@DefaultNameSpacePrefix | If the XML use a Default Namespaces like xmlns="namespaceURI" a prefix must be use in the XPath. Default prefix is “ns” |
@Filter | Filter the result of the selected data. See Command Maps & Parameters for more information. |
@Order | Order the result of the selected data. See Command Maps & Parameters for more information. |
Map
From | XPath to the element or attribute containing the desired value |
To | Name of the Header as it should be called in the Output table |
Script | Not supported by this Command.If you need to perform any manipulation via script, do this in a following step, by passing the result to another Command such as SELECT or SELECT.UNIQUE. |
Example 1
Below example will read the specified parts of an Xml-file in the BMEcat format.
Action Map - From | To | Command |
| XMLTable1 | SELECT.XML |
/PRODUCT | @Context |
|
PRODUCT_DETAILS/* |
|
|
PRODUCT_ORDER_DETAILS/ORDER_UNIT |
|
|
PRODUCT_PRICE_DETAILS/PRODUCT_PRICE[@price_type='']/PRICE_AMOUNT | PriceAmountDefault | |
SUPPLIER_PID |
|
|
Example 2
Below example is the same as above, but extended, to show how easy it is (with a few extra mappings) to also include all the Feature and Attribute values from the BMEcat-format.
Action Map - From | To | Command |
| XMLTable1 | SELECT.XML |
/PRODUCT | @Context |
|
PRODUCT_DETAILS/* |
|
|
PRODUCT_ORDER_DETAILS/ORDER_UNIT |
|
|
PRODUCT_PRICE_DETAILS/PRODUCT_PRICE[@price_type='']/PRICE_AMOUNT | PriceAmountDefault |
|
SUPPLIER_PID |
|
|
| XMLFeatures | SELECT.XML |
/PRODUCT/PRODUCT_FEATURES/FEATURE | @Context |
|
../../SUPPLIER_PID |
|
|
FNAME |
|
|
FVALUE |
|
|
FORDER |
|
|
XMLFeatures | XMLUNIQUE | SELECT.UNIQUE |
SUPPLIER_PID |
|
|
FVALUE |
|
|
XMLUNIQUE | XMLTable2 | JOIN |
Example 3
Example of an XML using Default and Prefixed Name Space
<?xml version="1.0" encoding="UTF-8"?>
<ROOT xmlns="www.test.com" xmlns:a="www.test.com/a">
<CATALOG>
<CATALOG_GROUP_SYSTEM>
<a:CATALOG_STRUCTURE type="root">
<GROUP_ID>1234</GROUP_ID>
<GROUP_NAME>abcd</GROUP_NAME>
</a:CATALOG_STRUCTURE>
</CATALOG_GROUP_SYSTEM>
</CATALOG>
</ROOT>
Action Map - From | To | Command |
| XMLTable1 | SELECT.XML |
//ns:CATALOG_GROUP_SYSTEM/a:CATALOG_STRUCTURE | @Context |
|
* |
|
|