次の方法で共有


_XDocument2.DOM プロパティ

定義

XML ドキュメント オブジェクト モデル (DOM) 形式でフォームの基になる XML ドキュメントへの参照を取得します。

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
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();

注釈

XDocument オブジェクトの主要なプロパティである DOM プロパティを使用すると、フォームのソース XML へのアクセスおよび操作をプログラムで行うことができます。 フォームのソース XML データが含まれている XML DOM への参照を設定すると、その XML DOM でサポートされているプロパティおよびメソッドを使用できるようになります。

重要: このメンバーにアクセスできるのは、現在開いているフォームと同じドメインで実行されているフォーム、またはクロスドメインアクセス許可が付与されているフォームのみです。

適用対象