Add
Adds a new custom XML part to the XML manager.
Syntax
expression.Add(xml);
expression - A variable that represents a ApiCustomXmlParts class.
Parameters
| Name | Required/Optional | Data type | Default | Description |
|---|---|---|---|---|
| xml | Required | string | The XML string to be added. |
Returns
Example
Attach a new custom XML part to a document.
// How do I add a custom XML part with specific content to a document?
// Embed structured XML data into a document to store metadata alongside the content in a document.
let doc = Api.GetDocument();
let xmlManager = doc.GetCustomXmlParts();
let newXml = xmlManager.Add("<content xmlns='http://example' version='1.0'></content>");
let infoParagraph = Api.CreateParagraph();
infoParagraph.AddText("New XML part added: " + newXml.GetXml());
doc.Push(infoParagraph);