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 / November 2005

Tip: Looking for answers? Try searching our database.

Correct XPATH Syntax datasource with filter

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
limitlessjb@yahoo.com - 22 Nov 2005 16:08 GMT
I have an Infopath form that gets submitted to a Sharepoint form
library. The field values are being overwritten with the default values
everytime the form is opened from Sharepoint.

My default value comes from a web service that returns a value based on
the value in another field. It looks like:

xdXDocument:GetDOM("GetvwEmployees")/dfs:myFields/dfs:dataFields/ns7:GetvwEmployeesResponse/ns7:GetvwEmployeesResult/NewDataSet/Table/utitle[../fullname
= xdXDocument:get-DOM()/my:myFields/my:Employee_Info/my:Name]

Instead, in my OnLoad event, I would like to test if the field is blank
before assigning this default value.

How can I assign this xpath value using code?

Thanks.
Franck Dauché - 22 Nov 2005 17:36 GMT
Hi,

Use something like:
IXMLDOMDocument3 oSecondDoc =
(IXMLDOMDocument3)thisXDocument.DataObjects["tblTest"].DOM;
oSecondDoc.setProperty("SelectionNamespaces",
"xmlns:dfs=\"http://schemas.microsoft.com/office/infopath/2003/dataFormSolution\"
xmlns:d=\"http://schemas.microsoft.com/office/infopath/2003/ado/dataFields\"");
IXMLDOMNode oSecDocNode =
oSecondDoc.selectSingleNode("/dfs:myFields/dfs:dataFields");

Then, to get to fldTest in that secondary document, use:
foreach (IXMLDOMNode oN in oSecDocNode.childNodes)
{
 if (oN.nodeType == DOMNodeType.NODE_ELEMENT)
 {
   IXMLDOMNode oField1 = oN.selectSingleNode("@fldTest");
 }
}

Hope that it helps.

Regards,

Franck Dauché

> I have an Infopath form that gets submitted to a Sharepoint form
> library. The field values are being overwritten with the default values
[quoted text clipped - 12 lines]
>
> Thanks.
 
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.