I'm have trouble with selectSingleNode...
If my data source looks like
myFields
FormData
VendorName
VendorPhone
then DummyString =
XDocument.DOM.selectSingleNode("/my:myFields/my:FormData/my:VendorName").text
works as expected.
If I create the form from a data connection, then my data source looks
like:
myFields
queryFields
dataFields
FormData
VendorName
VendorPhone
and
XDocument.DOM.selectSingleNode("/my:myFields/my:FormData/my:VendorName").text
does NOT work - using vbscript, it gives an error of Object required:
'XDocument.DOM.selectSingleNode(...)'
What am I doing wrong? How do I select a node when I create a from a
data connection?
First, you can't access the secondary data source from the main data source dom. You must use:
XDocument.GetDOM("My Secondary Data Source").selectSingleNode("...");
Second, the secondary data source might have a different namespace than "my"... you need to check for that.

Signature
Greg Collins [InfoPath MVP]
Please visit: http://www.InfoPathDev.com
I'm have trouble with selectSingleNode...
If my data source looks like
myFields
FormData
VendorName
VendorPhone
then DummyString =
XDocument.DOM.selectSingleNode("/my:myFields/my:FormData/my:VendorName").text
works as expected.
If I create the form from a data connection, then my data source looks
like:
myFields
queryFields
dataFields
FormData
VendorName
VendorPhone
and
XDocument.DOM.selectSingleNode("/my:myFields/my:FormData/my:VendorName").text
does NOT work - using vbscript, it gives an error of Object required:
'XDocument.DOM.selectSingleNode(...)'
What am I doing wrong? How do I select a node when I create a from a
data connection?
Bob P - 01 Dec 2004 01:30 GMT
That was it - it should have been
XDocument.DOM.selectSingleNode("/dfs:myFields/my:FormData/my:VendorName").text
Thanks for the help (and for the helpful website!)
>Second, the secondary data source might have a different namespace than "my"... you need to check for that.