_XDocument3.DOM 属性

定义

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

public:
 property Microsoft::Office::Interop::InfoPath::SemiTrust::IXMLDOMDocument ^ DOM { Microsoft::Office::Interop::InfoPath::SemiTrust::IXMLDOMDocument ^ get(); };
public Microsoft.Office.Interop.InfoPath.SemiTrust.IXMLDOMDocument DOM { get; }
member this.DOM : Microsoft.Office.Interop.InfoPath.SemiTrust.IXMLDOMDocument
Public ReadOnly Property DOM As IXMLDOMDocument

属性值

实现

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.<span class="label">DOM</span>.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.
DataSourceObject employeesDO =
   (DataSourceObject)thisXDocument.DataObjects["Employees"];
employeesDO.Query();
// 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.<span class="label">DOM</span>.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.
DataSourceObject employeesDO =
   (DataSourceObject)thisXDocument.DataObjects["Employees"];
employeesDO.Query();

注解

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

重要提示:此成员只能由与当前打开的窗体在同一域中运行的表单访问,或者由已授予跨域权限的表单访问。

适用于