Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.spojit.com/llms.txt

Use this file to discover all available pages before exploring further.

The XML Tools connector provides operations for working with XML — parsing, converting to and from JSON, formatting, and validation.
No connection required — this utility connector works out of the box.

Tools

xml
string
required
XML string to convert.
ignoreAttributes
boolean
default:"false"
Ignore XML attributes.
attributePrefix
string
default:"@_"
Prefix for attribute keys in JSON.
textNodeName
string
default:"#text"
Key name for text nodes.
preserveOrder
boolean
default:"false"
Preserve element order in output.
Example request:
{
  "xml": "<catalog><book id=\"1\"><title>Dune</title><price>12.99</price></book><book id=\"2\"><title>Neuromancer</title><price>9.99</price></book></catalog>"
}
Example response:
{
  "value": {
    "catalog": {
      "book": [
        { "@_id": "1", "title": "Dune", "price": 12.99 },
        { "@_id": "2", "title": "Neuromancer", "price": 9.99 }
      ]
    }
  }
}
data
any
required
JSON data to convert.
rootName
string
default:"root"
Root element name.
attributePrefix
string
default:"@_"
Prefix that identifies attributes.
textNodeName
string
default:"#text"
Key name for text content.
declaration
boolean
default:"true"
Include XML declaration.
pretty
boolean
default:"true"
Format with indentation.
Example request:
{
  "data": {
    "user": {
      "@_role": "admin",
      "name": "Alice",
      "email": "alice@example.com"
    }
  },
  "declaration": true,
  "pretty": true
}
Example response:
{
  "result": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<user role=\"admin\">\n  <name>Alice</name>\n  <email>alice@example.com</email>\n</user>"
}
Parse XML and return structured data with metadata.
xml
string
required
XML string to parse.
Example request:
{
  "xml": "<order id=\"789\"><item sku=\"A1\">Widget</item><total>29.99</total></order>"
}
Example response:
{
  "rootElement": "order",
  "data": {
    "order": {
      "@_id": "789",
      "item": {
        "@_sku": "A1",
        "#text": "Widget"
      },
      "total": 29.99
    }
  }
}
Format XML with indentation for readability.
xml
string
required
XML string to format.
indent
number
default:"2"
Number of indentation spaces.
Example request:
{
  "xml": "<root><name>Alice</name><age>30</age></root>",
  "indent": 4
}
Example response:
{
  "result": "<root>\n    <name>Alice</name>\n    <age>30</age>\n</root>"
}
Remove all unnecessary whitespace from XML.
xml
string
required
XML string to minify.
Example request:
{
  "xml": "<root>\n  <name>Alice</name>\n  <age>30</age>\n</root>"
}
Example response:
{
  "result": "<root><name>Alice</name><age>30</age></root>"
}
Check if a string is valid XML.
xml
string
required
XML string to validate.
Example request:
{
  "xml": "<root><name>Alice</name></root>"
}
Example response:
{
  "valid": true
}
Extract a specific element using dot-notation path.
xml
string
required
XML string.
path
string
required
Dot-notation path (e.g., root.items.item).
Example request:
{
  "xml": "<catalog><books><book>Dune</book><book>Neuromancer</book></books></catalog>",
  "path": "catalog.books.book"
}
Example response:
{
  "value": ["Dune", "Neuromancer"]
}