Hi there i am wondering what is the best practice to parse xml in outsystems?
regards
In OutSystems 11 you typically choose between two main approaches, depending on your use case and the XML complexity.
Best when:
Typical pattern:
Convert Binary to Text (if your XML comes as Binary, e.g. from SOAP/REST/file):
BinaryDataToText
Load XML into a DOM:
XmlDocument_Load_v2
XmlDocument
Select nodes with XPath:
XmlDocument_SelectNodes
"web"
"/bookstore/book[@category='web']"
XmlNodeList
Loop through nodes:
XmlNodeList_Count
Current
XmlNodeList_Item
Extract values from each node:
title
author
XmlElement_SelectSingleNode
"title"
"author"
XmlElement_GetInnerText
Book
This approach is “manual” but is the most standard/best-practice way documented by OutSystems for parsing XML.
If your XML is base64‑encoded, first decode using:
Base64ToBinary
XML Records lets you:
XML Records
This is very convenient for scenarios like:
If the goal is just to show the XML nicely formatted on screen (with indentation, nodes, etc.), use the XML Prettify O11 Forge component. Display XML content on screen with nodes
To extract data and process it → Use the XML Extension + XPath or XML Records:
To present XML to users (read‑only, pretty view) → Use XML Prettify.
If you can share whether you mainly want to:
I can suggest the exact flow (server actions, variables, and components) tailored to that scenario.