> Markdown versions of all pages of this connector library are available by appending `.md` to the page URL. For the full index of connectors, see [llms.txt](https://connectors.appmixer.com/llms.txt).

# appmixer.utils.xml.ValidateXml

- Component: `appmixer.utils.xml.ValidateXml`
- Kind: Action
- Version: 1.0.0
- Visibility: Public
- Connector: [appmixer.utils.xml 1.0.8](https://connectors.appmixer.com/connector/appmixer.utils.xml/1.0.8.md)
- Component page: <https://connectors.appmixer.com/connector/appmixer.utils.xml/1.0.8/component/appmixer.utils.xml.ValidateXml>

Validate XML.

## Input ports

### Port `in`

| Field | Type | Description |
| --- | --- | --- |
| XML (`xml`) | textarea | XML to be validated. |
| Allow Boolean Attributes (`allowBooleanAttributes`) | toggle | Set if a tag can have boolean attributes. |
| Unpaired Tags (`unpairedTags`) | text | Unpaired Tags are the tags which don't have a matching closing tag. Eg in HTML. Parse unpaired tags by providing their comma separated list. |

## Output ports

### Port `out`

| Field | Type | Description |
| --- | --- | --- |
| Is Valid (`isValid`) | boolean | - |
| Error Code (`err.code`) | string | - |
| Error Message (`err.msg`) | string | - |
| Error Line Number (`err.line`) | integer | - |
| Error Column Number (`err.col`) | integer | - |

## Full metadata (component.json)

```json
{
  "name": "appmixer.utils.xml.ValidateXml",
  "author": "David Durman <david@client.io>",
  "description": "Validate XML.",
  "inPorts": [
    {
      "name": "in",
      "schema": {
        "type": "object",
        "properties": {
          "xml": {
            "type": "string"
          },
          "allowBooleanAttributes": {
            "type": "boolean"
          },
          "unpairedTags": {
            "type": "string"
          }
        }
      },
      "inspector": {
        "inputs": {
          "xml": {
            "type": "textarea",
            "label": "XML",
            "index": 1,
            "tooltip": "XML to be validated."
          },
          "allowBooleanAttributes": {
            "type": "toggle",
            "label": "Allow Boolean Attributes",
            "defaultValue": false,
            "index": 2,
            "tooltip": "Set if a tag can have boolean attributes."
          },
          "unpairedTags": {
            "type": "text",
            "label": "Unpaired Tags",
            "index": 3,
            "tooltip": "Unpaired Tags are the tags which don't have a matching closing tag. Eg <br> in HTML. Parse unpaired tags by providing their comma separated list."
          }
        }
      }
    }
  ],
  "outPorts": [
    {
      "name": "out",
      "options": [
        {
          "label": "Is Valid",
          "value": "isValid",
          "schema": {
            "type": "boolean",
            "example": false
          }
        },
        {
          "label": "Error Code",
          "value": "err.code",
          "schema": {
            "type": "string",
            "example": "InvalidTag"
          }
        },
        {
          "label": "Error Message",
          "value": "err.msg",
          "schema": {
            "type": "string",
            "example": "Expected closing tag 'body' (opened in line 3, col 5) instead of closing tag 'note'."
          }
        },
        {
          "label": "Error Line Number",
          "value": "err.line",
          "schema": {
            "type": "integer",
            "example": 4
          }
        },
        {
          "label": "Error Column Number",
          "value": "err.col",
          "schema": {
            "type": "integer",
            "example": 3
          }
        }
      ]
    }
  ],
  "icon": "(data URI omitted)"
}
```
