Maya Docs
  • Introducing Maya
  • Product
    • Command Bar
    • Workspaces
      • Importing JSON Workflows
    • Modules
      • Config Profiles
    • Node Library
      • Common
        • Inject
        • Debug
        • Complete
        • Catch
        • Status
      • Functions
        • Function
        • Change
        • Switch
        • Template
        • Range
        • Delay
        • Trigger
        • Filter
        • Exec
      • Storage
        • Read File
        • Modify File
        • Watch Files
      • Parser
        • CSV
        • HTML
        • JSON
        • XML
        • YAML
      • Sequence
        • Split Into Array
        • Join Array
        • Sort Array
        • Batch Messages
      • Dashboard
        • Button
        • Chart
        • Slider
        • Gauge
        • Switch
        • Dropdown
        • Numeric Input
        • Text Input
        • Template
        • Date Picker
        • Colour Picker
        • Form
        • Display Text
        • Audio Out
      • Network
        • Websockets
          • Websocket Out
          • Websocket In
        • HTTP
          • HTTP In
          • HTTP Response
          • HTTP Request
      • Command Bar
        • Bot Scheduler
        • Bot Command In
        • Bot Command Out
          • Bot Response
          • Bot Web Card
          • Bot Dash Card
        • Custom Search In
        • Custom Search Out
        • Bot Info
      • Spotify
        • Get Playback State
        • Control Playback
        • Play
        • Library
        • Playlist
        • Search
    • Web Extension
      • Selecting Elements
      • Making a web automation skill in 5 minutes
    • Troubleshooting
    • Changelog
  • Tutorials
    • Install skills/modules from store
    • Building fundamentals
    • Connect different services
      • Spotify + Figma
      • Zoom + Google Calendar
    • Browser Automation
      • Control YouTube - Easy
      • Scrape Twitter - Moderate
      • Manage Gmail Inbox - Hard
Powered by GitBook
On this page
  • Inputs
  • Outputs
  • Details

Was this helpful?

  1. Product
  2. Node Library
  3. Parser

XML

Converts between an XML string and its JavaScript object representation, in either direction.

PreviousJSONNextYAML

Last updated 3 years ago

Was this helpful?

Inputs

  • payload (object | string) : A JavaScript object or XML string.

  • options (object) : This optional property can be used to pass in any of the options supported by the underlying library used to convert to and from XML. See for more information.

Outputs

  • payload (object | string) :

    • If the input is a string it tries to parse it as XML and creates a JavaScript object.

    • If the input is a JavaScript object it tries to build an XML string.

Details

When converting between XML and an object, any XML attributes are added as a property named $ by default. Any text content is added as a property named _. These property names can be specified in the node configuration.

For example, the following XML will be converted as shown:

<p class="tag">Hello World</p>
{
  "p": {
    "$": {
      "class": "tag"
    },
    "_": "Hello World"
  }
}
the xml2js docs