GetCustomXmlParts
Retrieves the custom XML manager associated with the document. This manager allows manipulation and access to custom XML parts within the document.
Syntax
expression.GetCustomXmlParts();
expression
- A variable that represents a ApiDocument class.
Parameters
This method doesn't have any parameters.
Returns
ApiCustomXmlParts | null
Example
This example shows how to get the custom XML manager, add a new XML part, and retrieve it by its ID.
- Code
- Result
let doc = Api.GetDocument();
let xmlManager = doc.GetCustomXmlParts();
let xmlText = "<content><text>Example XML</text></content>";
let xmlPart = xmlManager.Add(xmlText);
let xmlId = xmlPart.GetId();
let retrievedXml = xmlManager.GetById(xmlId);
let infoParagraph = Api.CreateParagraph();
infoParagraph.AddText("Retrieved XML: " + retrievedXml.GetXml());
doc.Push(infoParagraph);