The XPath XML Extractor Component extracts data from XML content using a specified XPath expression. This allows precise retrieval of elements, attributes, or values from structured XML data.
This component takes an XML string as input and applies an XPath query to extract specific information.
in
Accepts an XML string and an XPath expression for processing.
Input Properties
xml
string
XML content to process.
xpath
string
XPath expression for selecting elements. E.g., '//title'
.
out
Provides the extracted data from XML based on the XPath expression.
Output Properties
result
string
Extracted data based on the given XPath expression.
Parse XML Input: Converts the input XML string into a DOM object.
Apply XPath Expression: Executes the XPath query on the parsed XML.
Format Extracted Data: If multiple matches are found, results are concatenated into a single string.
Send Output: The extracted data is emitted through the out
port.
Flexible Queries: Supports selecting elements, attributes, and text nodes via XPath.
Handles Multiple Matches: When multiple elements match the XPath, results are concatenated.
Efficient XML Parsing: Uses xmldom
and xpath
libraries for reliable parsing and selection.
This component provides a powerful way to extract and manipulate XML data using XPath expressions, making it highly useful for XML-based workflows.
The XML Validation Component verifies whether an input XML string is well-formed and conforms to certain validation rules. It supports options for boolean attributes and unpaired tags, ensuring that the XML structure meets expected standards.
This component takes an XML string as input and checks for syntax errors, invalid structures, and unsupported tags. If the XML is valid, it outputs a confirmation; otherwise, it returns error details.
Input Properties
Output Properties
Parse XML Input: Accepts an XML string and applies validation rules.
Apply Boolean Attribute Handling: Determines whether attributes can be boolean.
Check Unpaired Tags: Validates unpaired tags against the provided list.
Return Validation Result: If valid, sends isValid: true
; if invalid, returns an error with details.
Boolean Attribute Support: Useful for HTML-like XML where some attributes don’t require values.
Custom Unpaired Tags: Enables validation for tags that don’t have closing counterparts.
Detailed Error Reporting: Helps identify structural issues with precise error messages and locations.
This component ensures XML correctness, aiding in proper document parsing and integration workflows.
in
Accepts an XML string for validation.
xml
string
XML content to validate.
allowBooleanAttributes
boolean
If true
, allows boolean attributes (e.g., <input checked>
).
unpairedTags
string
Comma-separated list of tags that don't require closing pairs (e.g., <br>
).
out
Provides validation results.
isValid
boolean
true
if XML is valid, false
otherwise.
err.code
string
Error code if XML is invalid.
err.msg
string
Error message detailing the issue.
err.line
number
Line number where the error occurred.
err.col
number
Column number where the error occurred.