_XDocument2.DOM 属性

获取一个对表单的基础 XML 文档的引用,采用 XML 文档对象模型 (DOM) 形式。

命名空间:  Microsoft.Office.Interop.InfoPath.SemiTrust
程序集:  Microsoft.Office.Interop.InfoPath.SemiTrust(位于 Microsoft.Office.Interop.InfoPath.SemiTrust.dll 中)

语法

声明
ReadOnly Property DOM As IXMLDOMDocument
    Get
用法
Dim instance As _XDocument2
Dim value As IXMLDOMDocument

value = instance.DOM
IXMLDOMDocument DOM { get; }

属性值

类型:Microsoft.Office.Interop.InfoPath.SemiTrust.IXMLDOMDocument

实现

_XDocument.DOM

备注

作为 XDocument 对象的关键属性,DOM 属性使您能够以编程的方式访问和操纵表单的源 XML。完成设置对 XML DOM(其中包含表单的源 XML 数据)的引用之后,可以使用 XML DOM 支持的任何属性和方法。

重要

此成员只能由与当前打开的表单在相同域中运行的表单访问,或者由已授予跨域权限的表单访问。

示例

// retrieve the Employees Adapter from the DataAdapters collection
ADOAdapter employeesDA=(ADOAdapter)thisXDocument.DataAdapters["Employees"];
// get employee’s ID from the main DOM
string employeeID=thisXDocument.DOM.selectSingleNode("//my:field2").text;
// Change the ADOAdapter’s command to retrieve the record of the Employee’s ID entered
// by the user
employeesDA.Command="select * from Employees where EmployeeID="+employeeID;
// get DataObject from the DataObjects collection and call Query to refresh
// the data object
DataObject employeesDO=thisXDocument.DataObjects["Employees"];
employeesDO.Query();

另请参阅

引用

_XDocument2 接口

_XDocument2 成员

DOM 重载

Microsoft.Office.Interop.InfoPath.SemiTrust 命名空间