XML - Node to Dataset

Declaration

<AMXMLNODEITERATOR XPATH="text" RESULTDATASET="theDataset" />

See Also

XML - Create Node | XML - Create Session | XML - Dataset to XML | XML - Delete Node | XML - Edit Node | XML - End Session | XML - Evaluate Xpath | XML - Export | XML - Import | XML - Read Node | XML - Save | XML - Sign | XML - Transform | XML - Validate | XML - Verify

XML Node to Dataset

Declaration

<AMXMLNODEITERATOR XPATH="text" RESULTDATASET="theDataset" />

See Also

Create XML Node | Dataset to XML | Delete XML Node | Edit XML Node | End XML Session | Evaluate Xpath Expression | Extract XML Fragment | Merge XML Files | Output XML | Read XML Node | Sign XML Document | Start XML Session | Transform XML | Validate XML File | Verify XML Document | XML Node to Dataset

Description

Retrieves the text value or XPath expression of each node in a document tree or the value of a specific attribute and populates a dataset with the results.  

IMPORTANT: AutoMate's XML actions require a basic understanding of XML and related terms, such as XPath, DTD and XSLT.

Practical Usage

Used to gather information regarding node objects or attributes in a document tree.  

Parameters

General Properties

Property

Type

Required

Default

Markup

Description

XPath Expression

Text

Yes

(Empty)

XPATH="sum(//price/text())"

The XPath Expression from the current XML document in which to retrieve values from.

Create the dataset of node values

Text

Yes

(Empty)

RESULTDATASET="theDataset"

The name of the dataset in which to create and populate with the node or attribute values.

Session Name

Text

No

XMLSession1

SESSIONNAME="MainXMLSession"

The name the session created in a previous Start XML Session step in which to identify the in-memory XML document that this step should reference. Sessions allow several in-memory XML documents to be active simultaneously.

Populate dataset with

Text (options)

No

Text value of each node

VARVALUETYPE="XpathValue"

Indicates the type of information to populate the specified dataset with. The available options are:

  • Text value of each node (default)

  • Value of a specific attribute

  • XPath expression of each node

Attribute name

Text

No

No

ATTRNAME="v"

The name of the attribute in which to retrieve values from. This parameter is available only if the Populate dataset with parameter is set to Value of a specific attribute.

Notes

Custom Description

This action includes the Description tab for entering a custom step description.

More on setting custom step description

Standard Error Handling Options

This action also includes the standard Error Causes and On Error failure handling options/tabs.

More on Error Handling Options

Variables and Expressions

All text fields allow the use of expressions, which can be entered by surrounding the expression in percentage signs (example: %MYVARIABLE%, %Left('Text',2)%). To help construct these expressions, you can open Expression Builder from these fields by pressing F2.

More on variables
More on expressions

More on the expression builder

Example

NOTE: The code below can be copied and pasted directly into the Steps pane of the Task Builder.

 

Description: This sample task creates a dataset named "NodeSet" containing XML node values of type "AttributeValue" at XPath location "/bookstore/book". The dataset is then looped and a message box is appears within each iteration displaying the value.

 

<AMXMLNODEITERATOR XPATH="/bookstore/book" RESULTDATASET="NodeSet" VARVALUETYPE="AttributeValue" ATTRNAME="category" />

<AMLOOP TYPE="DATASET" DATASET="NodeSet">

     <AMSHOWDIALOG>%NodeSet.Value%</AMSHOWDIALOG>

</AMLOOP>

<AMXMLENDSESSION />

 

↑ Top of Page