DOM.selectNodes

P

Paul Webster

Well a day on I am still trying to populate a text box on a form with a
field related to a field input to the form from a secondary data source.
As a simple example, I have the Beatles names in a database , if I
select Lennon from the dropdown list, I want to complete at text box on
the form with John.

I am using C#. I can get hold of the text box field with selectSingleNode.

I can get hold of the secondary data source by creating a
DataSourceObject. If I display my secondary datasource objects xml it
looks like this.

<dfs:myFields
xmlns:dfs="http://schemas.microsoft.com/office/infopath/2003/dataFormSolution">
<dfs:dataFields>
<d:Beatles
xmlns:d="http://schemas.microsoft.com/office/infopath/2003/ado/dataFields"
Fname="John" Sname="Lennon"/>
<d:Beatles
xmlns:d="http://schemas.microsoft.com/office/infopath/2003/ado/dataFields"
Fname="Paul" Sname="McCartney"/>
<d:Beatles
xmlns:d="http://schemas.microsoft.com/office/infopath/2003/ado/dataFields"
Fname="George" Sname="Harrison"/>
<d:Beatles
xmlns:d="http://schemas.microsoft.com/office/infopath/2003/ado/dataFields"
Fname="Ringo" Sname="Star"/>
</dfs:dataFields></dfs:myFields>

I am trying to select this data into a nodelist so that I can spin
through it with a foreach statement, compare it to the drop down list
value and populate the textbox. I cannot, however, get my selectNodes
function to select the data. Any help would be appreciated.


IXMLDOMNodeList namelist = myDataObject.DOM.selectNodes("/myFields");
foreach(IXMLDOMNode namenode in namelist)
{
thisXDocument.UI.Alert((string)namenode.nodeTypedValue);
}


Paul Webster
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top