Very simple XPath question....

B

Blain Timberlake

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

S.Y.M. Wong-A-Ton

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/..."?
 

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

Similar Threads


Top