XML Records

Stable Version 1.6.7 (O11)
Also available for 10, 9.1, 9.0, Older
Published on 25 November 2019 by 
Created on 06 May 2010
Documentation

XMLRecords is an extension that allows you to convert OutSystems Records and RecordLists into XML and vice-versa. For implementation examples, check the Try Now link above.


Actions:

 - RecordListToXML: This method allows you to convert a record list into structured XML. You can add aliases to nodes through the AttributesConfig structure, as well as specifying a Namespace. Finally, you can force a wrapping node to the resulting output in order to have valid XML;

 - RecordToXML: This method allows you to convert a single record into structured XML. You can add aliases to nodes through the AttributesConfig structure, as well as specifying a Namespace;

 - XmlToRecordList: This method allows you to parse XML and fill out a RecordList. No outputs will be returned, as the RecordList you select will be filled with the result of the parse. You may elect to ignore the XML declaraction and namespace, as well as define behaviour with regards to attribute prefixes and root nodes.


FAQ

1. I can't use my structures as inputs in the exposed actions, as they need an Object type. How do I structure my inputs?

Regardless of the content of your structures, the extension must receive your structures as generic Objects. You must always feed your structures and record lists using the ToObject() OutSystems method.

2. Both RecordToXml and XmlToRecordList always return empty structures and empty record lists. How can I ensure the extension properly maps results to my structures?

Your record lists and structures must always be records. You cannot directly use the types you create when mapping structures and record lists, otherwise the extension will not be able to fill out your structures.


3. I get an error regarding multiple root nodes when I use the RecordListToXml action. What do I need to do?

When you parse multiple records in a record list and attempt to convert it to XML, the resulting XML must always have a global root node in order to be valid (one single node from which all other nodes are descendants). You can use the AddRootNode flag to ensure this.


Support Options
This component is not supported by OutSystems. You may use the discussion forums to leave suggestions or obtain best-effort support from the community, including from Afonso Carvalho who created this component.
Dependencies
XML Records has no dependencies.