GetId
返回自定义 XML 部件的 ID。
语法
expression.GetId();
expression - 表示 ApiCustomXmlPart 类的变量。
参数
此方法没有任何参数。
返回值
string
示例
此示例演示如何检索自定义 XML 部件的 ID。
let doc = Api.GetDocument();
let xmlManager = doc.GetCustomXmlParts();
let xml = xmlManager.Add("<content xmlns='http://example'></content>");
let xmlId = xml.GetId();
let paragraph = Api.CreateParagraph();
paragraph.AddText("Custom XML ID: " + xmlId);
doc.Push(paragraph);