Skip to main content

GetAll

Returns all custom XML parts from the XML manager.

Syntax​

expression.GetAll();

expression - A variable that represents a ApiCustomXmlParts class.

Parameters​

This method doesn't have any parameters.

Returns​

ApiCustomXmlPart[]

Example​

List every custom XML part stored in a document.

// How do I retrieve all custom XML parts at once in a document?

// Iterate over every embedded XML part to audit or process stored data in a document.

let doc = Api.GetDocument();
let xmlManager = doc.GetCustomXmlParts();
let xmlText1 = '<products><item><name>Laptop</name><price>999</price></item></products>';
let xmlText2 = '<user><name>John Doe</name><email>john@example.com</email></user>';

let xml1 = xmlManager.Add(xmlText1);
let xml2 = xmlManager.Add(xmlText2);

let allXmlParts = xmlManager.GetAll();
let infoParagraph = Api.CreateParagraph();
infoParagraph.AddText("All custom XML parts: " + allXmlParts.map(xml => xml.GetXml()).join(", "));
doc.Push(infoParagraph);