Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / General MS InfoPath Questions / December 2004

Tip: Looking for answers? Try searching our database.

Help with selectsinglenode!

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Bob P - 30 Nov 2004 23:10 GMT
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?
Greg Collins [InfoPath MVP] - 01 Dec 2004 00:49 GMT
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.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.