Step Details |
Introduced in Version | --- |
Last Modified in Version | 7.12.0 |
Location | Data > XML |
The XPath Query step is a data processing step in which an XPath expression is used to select specific nodes or node sets from an XML document. XPath is a query language for navigating and extracting data from XML structures. Utilize the XPath Query to easily pinpoint and retrieve the desired data elements from within the XML document, making it a valuable tool for XML processing tasks such as data extraction, manipulation, and filtering.
Properties
Inputs
Property | Description | Data Type |
---|
To Query | Specify the string-based path of the XML document or XML data on which the XPath query will be executed. | Object |
Xpath | The XPath expression that defines the path or steps to select specific nodes or node sets within the XML document. The XPath expression should be in accordance with the XPath language specifications. | String |
Outputs
Property | Description | Data Type |
---|
XPath Query Result | The result of the XPath query execution. It includes the selected nodes or node sets from the XML document based on the provided XPath expression. | List of String |
Query
Property | Description | Data Type |
---|
Get XPath from Input | Extract the XPath expression from an input field or variable. It is useful to dynamically set the XPath at runtime based on external inputs or conditions. | Boolean |
| Xpath | This setting manually specifies the XPath expression when "Get XPath from Input" is not enabled. | String |
Namespaces | Provide a Prefix and URI. | --- |
Return XML | If enabled, the output will be in XML format, preserving the structure of the selected nodes or node sets. | Boolean |
| Return Type | This gives the option to return the data in the chosen preferred type. Only Available if Return XML is not set to true. | --- |

Common Errors
Data at the root level is invalid.
The following error message indicates that there is an issue with parsing an XML document. The error specifically mentions, "Data at the root level is invalid. Line 1, position 1." This usually indicates that the XML data being processed is not well-formed, meaning it doesn't adhere to the XML syntax rules.
Exception Message:
Exception Stack Trace: DecisionsFramework.Design.Flow.ErrorRunningFlowStep: Error running step XPath Query 1[XPathQueryStep] in flow [Display Steps]: Data at the root level is invalid. Line 1, position 1.
---> System.Xml.XmlException: Data at the root level is invalid. Line 1, position 1. at System.Xml.XmlTextReaderImpl.Throw(Exception e
at System.Xml.XmlTextReaderImpl.Throw(String res, String arg
at System.Xml.XmlTextReaderImpl.ParseRootLevelWhitespace(
at System.Xml.XmlTextReaderImpl.ParseDocumentContent(
at System.Xml.XPath.XPathDocument.LoadFromReader(XmlReader reader, XmlSpace space
at System.Xml.XPath.XPathDocument..ctor(TextReader textReader
at DecisionsFramework.Design.Flow.CoreSteps.XML.XPathQueryStep.Run(StepStartData data
at DecisionsFramework.Design.Flow.FlowStep.RunStepInternal(String flowTrackingID, String stepTrackingID, KeyValuePairDataStructure[] stepRunDataValues, AbstractFlowTrackingData trackingData
at DecisionsFramework.Design.Flow.FlowStep.Start(String flowTrackingID, String stepTrackingID, FlowStateData data, AbstractFlowTrackingData trackingData, RunningStepData currentStepData)