Edit

Share via


_XDocument2.DOM Property

Definition

Gets a reference to a form's underlying XML document in the form of an XML Document Object Model (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

Property Value

Implements

DOM

Examples

// 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
DataObject employeesDO=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
DataObject employeesDO=thisXDocument.DataObjects["Employees"];
employeesDO.Query();

Remarks

A key property of the XDocument object, the DOM property allows you to programmatically access and manipulate the source XML of a form. After you have set a reference to the XML DOM, which contains the source XML data of a form, you can use any of the properties and methods that are supported by the XML DOM.

Important: This member can be accessed only by forms running in the same domain as the currently open form, or by forms that have been granted cross-domain permissions.

Applies to