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 2006

Tip: Looking for answers? Try searching our database.

Very simple XPath question....

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Blain  Timberlake - 21 Nov 2006 17:29 GMT
On my first form I only had one data source (Main)
and used the following code to set my file name prior to a save

meetingName = XDocument.DOM.selectSingleNode( "//my:field1" ).text;
meetingDate = XDocument.DOM.selectSingleNode( "//my:field2" ).text;
XDocument.UI.SetSaveAsDialogFileName(meetingDate + " - " +
meetingName);

Very simple...

Now on a new form I've got two data sources, again the field I'm trying
to use is simply a text box on the main form, but I just cannot get the
syntax correct.  Name of the field is "UseCaseName"

I've tried:

docName = XDocument.DOM.selectSingleNode( "//my:UseCaseName" ).text;

I've tried it many different ways but simply cannot reference it, if I
navigate to it using the expression control that field is shown as
"my:UseCaseName"

But everytime I run this I get that the object cannot be found.

Please help, I know it is something ridiculously simple...

Thanks.
S.Y.M. Wong-A-Ton - 22 Nov 2006 06:57 GMT
It is not a simple question if the structure of your form is unknown to
others. :)

Try saving your form (fill it out and save it as XML), download a tool
called "Visual XPath" (see
http://weblogs.asp.net/nleghari/articles/27951.aspx), load the XML for your
form in it, and type in and try finding the correct XPath to the XML node you
require.

Did you already try the full XPath expression to the node? That is,
"/my:myFields/..."?
---
S.Y.M. Wong-A-Ton

> On my first form I only had one data source (Main)
> and used the following code to set my file name prior to a save
[quoted text clipped - 23 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.