We are currently using OutSystems 11 (O11) and have a requirement to compare two XML files.
The expected functionality is as follows:
I would like to understand what would be the best and most maintainable approach in OutSystems 11 for implementing this functionality.
Specifically:
I would appreciate any recommendations based on best practices for OutSystems 11, particularly regarding maintainability and performance.
Thank you in advance for your suggestions.
We have done this using writing our customized logic in C# code using extension.
Hi @Biswanath Satpathy ,
There is a forge component from 2007, but it's most probably outdated. I would recommend creating your own C# extension, you can use something like this library: XMLUnit.NET .
Thank you for your suggestion. We will explore the proposed approach and work towards resolving the issue accordingly.
For O11 there’s no built‑in “XML diff” action, but you can implement this cleanly using existing patterns and/or a small Extension. You basically have three options:
If you want to stay 100% in OutSystems and keep it maintainable, I’d start here.
Use the XML Records O11 Forge component to convert each XML into OutSystems Record / Record List structures that mirror the XML tree. Parsing complex XML files
Typical flow on upload:
Once both XMLs are represented as Record/Record List structures, you can compare them using normal OutSystems logic:
Define a DiffResult structure with fields like:
/Invoice/Lines[3]/ProductCode
Implement server actions that:
Id
Code
Name
This gives you:
Pros
Cons / considerations
If your XML is “business data” (e.g. invoices, products, configs), this is usually the most maintainable solution.
If you prefer to work at XML level (no auto‑mapping to structures), you can use OutSystems’ XML extension with XPath and build the diff yourself. How to parse XML files with XPath expressions
Typical flow:
XmlDocument_Load_v2
Cons
This is still maintainable if you encapsulate all logic in a small set of server actions (e.g. XMLDiff_CompareDocuments) and keep the XPath rules clearly documented.
XMLDiff_CompareDocuments
If you need a robust, generic XML diff with full support for namespaces, attributes, ordering rules, and want to reuse existing .NET libraries (e.g. Microsoft XML Diff & Patch), then an OutSystems Extension is a good choice.
<add>
<remove>
<change>
XMLDiff_Compare(OldXmlText, NewXmlText)
DiffResultList
If your team is comfortable with C# and you want a “black box” XML diff, this is often the most straightforward.
Currently, there is no widely‑used, generic Forge component dedicated to XML diff equivalent to “Compare Entity” for entities. I want to compare two structure data and display the different data in list
However, you can combine Forge components:
Given your requirements (track added/removed/modified nodes and values, show differences to the user, O11, maintainable):
Persist XML versions:
XmlDocument
DocumentKey
Version
XmlContent
UploadedOn
UploadedBy
Compare on upload:
XMLDiff_Compare
Generate a DiffResult list:
Optionally:
If you don’t have strong C# experience, I’d start with XML Records + custom OutSystems diff; it’s very maintainable, transparent to OutSystems developers, and leverages the platform’s strengths. If later you hit performance or need more advanced comparison rules, you can encapsulate the diff in a C# Extension and keep the rest (storage, UI, flows) unchanged.
We have 5 options.
For an O11 enterprise application, I'd choose:
Option 1 — C# Extension + standard XML APIs ⭐⭐⭐⭐⭐
Best when you need complete control and long-term maintainability.
Option 2 — C# Extension + mature XML diff library ⭐⭐⭐⭐⭐
Best if the library already provides exactly the structural diff semantics you need.
Option 3 — Forge component ⭐⭐⭐
Good if you find a mature, actively maintained component that meets your exact XML requirements.
Option 4 — String comparison ⭐
I would avoid this for a true XML comparison.
Thank you for your response. we have done this using C# extension.
You can use the Forge components below
https://www.outsystems.com/forge/component-overview/23816/filediff-tool-o11
https://www.outsystems.com/forge/component-overview/47/compare2xml-o11