Houdini 20.0 Nodes TOP nodes

Xml Input TOP node

Extracts data from XML into Work Item attributes

On this page
Since 17.5

This node parses XML data and can extract complete elements, attributes or text values into Work Item attributes. The query can be specified using either XPath, or through simplified name-based matching parameters.

Note

XPath 1.0 is supported with the lxml library.

Parameters

Generate When

Determines when this node will generate work items. You should generally leave this set to “Automatic” unless you know the node requires a specific generation mode, or that the work items need to be generated dynamically.

All Upstream Items are Generated

This node will generate work items once all of the input nodes have generated their work items.

All Upstream Items are Cooked

This node will generate work items once all of the input nodes have cooked their work items.

Each Upstream Item is Cooked

This node will generate work items each time a work item in an input node is cooked.

Automatic

The generation mode is selected based on the generation mode of the input nodes. If any of the input nodes are generating work items when their inputs cook, this node will be set to Each Upstream Item is Cooked. Otherwise, it will be set to All Upstream Items are Generated.

Source

XML Source

Upstream XML File: Reads from input file with the given File Tag.

Custom File Path: Reads from the given XML File path.

Upstream XML Attribute: Reads from an attribute given by the Attribute Name on the upstream Work Item. This can be a File or string attribute.

Custom String: Reads from the given string value.

File Tag

#id sourcefiletag

The file tag of the upstream file.

XML File

The filepath of the XML file that should be parsed.

Attribute Name

The name of the attribute from which to read XML data.

XML

The XML string to parse.

Query

Query Method

XPath: Use an XPath expression. XPath is a full-featured query language for XML documents. The expression can return single attribute values, complete elements or lists of results.

By Element Name: Use the given parameters to specify an element name and optionally attribute name to match.

Match

Any Elements: Match any elements in the XML source.

Child Elements: Match only child elements of the active element. (Not the active element itself)

XPath Expression

The XPath expression to be evaluated. Note that the 'active element' is the root element of the upstream XML data.

Element Tag

The name of the XML element to be matched.

Extract

Element: Extract the complete matched element, which is everything between the start and end tags.

Element Text: Extract the text value of the element. For example Test, the string 'Test' would be extracted.

Attribute: Extract the value of the supplied Attribute Name.

Attribute Name

The name of the attribute to extract. The value can be converted from the read string using Match Storage Type.

No Match

Add Warning: Adds a warning to the node but does not fail.

Raise Error: Issues a fatal error which stops the cook.

Generate Item: Creates an empty item representing the failed match.

Storage

Create Work Item

For Each Match: One Work Item is created for each match result.

For All Matches: One Work Item is created for all results. This may result in array attributes to hold the result values.

Match Storage Type

Element: The query result must be an Element, and it will be written out as either an XML string attribute or an XML file.

String: The query result(s) will be converted to a string attribute.

Integer: The query result(s) will be converted to an integer attribute.

Float: The query result(s) will be converted to a float attribute.

File: The query result(s) will be converted to a file path.

Store Element Match

When the Match Storage Type is Element, how to save it.

As String Attribute: Save the Element as an XML fragment in a string attribute.

Write To File: Write the XML element(s) to a file.

Attribute Name

The name of the attribute that gets created to hold the extracted data.

File Path

The path to a file to be created when Write To File is active.

Root Name

When Create Work Item is set to For All Matches and Store Element Match is set to Write To File, the matching Element(s) will be children of this Root.

Examples

InputXML Example for Xml Input TOP node

This example demonstrates how to create work items from XML data using the XML Input TOP node.

TOP nodes