XML Tools

Parse and transform XML data.

Overview

The XML Tools connector is a workflow-side utility for working with XML data: parsing, converting between XML and JSON, validating, and extracting specific elements via XPath-style queries. It runs entirely inside Spojit and does not call any external service.

Most modern APIs are JSON, but XML is still the native format for many legacy ERPs, SOAP services, financial systems, and government data feeds. Use this connector at the boundary - convert incoming XML to JSON for the rest of your workflow, or convert outgoing JSON to XML right before the call.

What You Can Do

The XML connector exposes these tools:

  • parse - Parse an XML string into a structured object.
  • to-json - Convert XML to JSON in one step.
  • from-json - Convert JSON to XML.
  • extract - Extract specific elements or attributes via XPath-style queries.
  • validate - Validate XML against a schema or for well-formedness.
  • prettify - Format XML with consistent indentation.
  • minify - Strip whitespace and comments for compact storage or transmission.

Authentication and Setup

No connection or authentication is required. These tools are built into the platform and available in every workflow by default - just drop a Connector node onto the canvas and pick the tool you need.

Using in a Workflow

Add a Connector node, select XML Tools, and choose Direct Mode with the operation you need. The most common pattern is a single to-json call right after an HTTP fetch of an XML payload - the rest of the workflow then works with JSON.

Tips

  • For deep XML documents where you only need a few fields, use extract with an XPath query instead of converting the whole tree to JSON.
  • SOAP envelopes nest your payload inside Body; extract the inner element before processing.
  • If the producing system rejects your XML, run prettify and check it visually - whitespace and namespace declarations often differ subtly.

Common Pitfalls

  • Attributes vs elements - JSON has no native attribute concept. The to-json conversion typically prefixes attributes with @; check the output shape before consuming.
  • CDATA sections - Some legacy feeds wrap text in <![CDATA[...]]>. The parser strips it transparently but downstream consumers expecting the raw bytes can be surprised.
  • Namespaces - Documents with multiple namespaces (e.g. SOAP + WS-Security) need namespace-aware XPath. Use extract with a fully-qualified query.
  • Encoding - Always check the XML declaration's encoding attribute and that the upstream service is honoring it. UTF-8 is safe; Windows-1252 is a frequent silent breaker.

Common Use Cases

Related Articles

For technical API details and field specifications, see the XML Tools documentation.

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.