XML Node to Dataset

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. Used to gather information regarding node objects or attributes in a document tree.

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

Declaration

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

Example

This example 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 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 />

See Also: Create XML Node, Delete XML Node, End XML Session, Evaluate Xpath Expression, Extract XML Fragment, Merge XML Files, Output XML, Read XML Node, Sign XML Document, Transform XML, Validate XML File

General Tab

Property

Type

Required

Default

Markup

Description

XPath Expression

Text

Yes

(Empty)

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

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

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.

Description Tab

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