Hi,
I have carefully read the topic : Exchanging data between modules.
Mr. Henning Krause has give a example of code to Andrea V.F. but the
things that I don't understand is what is the type of url, doc, dom? is
it string? I don't think so
I try to make this with C#
The code of Mr. Krause:
// The url of the second form, must be absolute (i.e.
c:\myforms\form.xsn).
//This example opens a form that lies in the same directory as the
source form
url = XDocument.Solution.URI;
url HttpUtility.UrlDecode(url.Substring(url.IndexOf("://")+4)).Replace("/",
"\\");
url = Path.Combine(Path.GetDirectoryName(url), "News Template.xsn");
// Open a new instance of the second xsn
doc = Application.XDocuments.NewFromSolution(url);
// Get the Datasource of the second form. Note: In Jscript you won't
need the casting to the IXMLDOMDocument2
dom = (IXMLDOMDocument2) doc.DOM;
// Set the namespace to the one used within the second document
dom.setProperty("SelectionNamespaces",
"http://schemas.microsoft.com/office/infopath/2003/myXSD/2005-07-11T12:39:14");
// Set the value
doc.DOM.selectSingleNode("//my:integervalue").text = 42;
Other question, you say :
//This example opens a form that lies in the same directory as the
source form
but if there are a lot of form in the same directory does it take the
form who correspond to the namespace given under?
I hope you will understand!
Thanks in advance for your help !
++
Thierry
Shiva[autonomysystems.com] - 03 Aug 2005 11:16 GMT
Hi Virgul,
Uri DocumentUrl = new Uri(thisXDocument.URI);
Provides an object representation of a uniform resource identifier (URI) and
easy access to the parts of the URI
IXMLDOMDocument2 domFormData = null;
An extension of DOMDocument that supports schema caching and validation
features, and switching on XML Path Language (XPath) support.
More information you want look at this below site
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/xmlsdk/html/832
083b0-9400-48eb-aa3c-6447d4b55c91.asp
Other question answer is:
If there is a lot of form in the same directory then we have to set whose
data connection to this dom document from below the statement in C# code.
domFormData = (IXMLDOMDocument2)thisXDocument.GetDOM("FormData");
In this "FormData" specify the data conneciton name.
This connection is receiving data from xml file or webservice or database or
sharepoint
Hope this Helps you
Shiva
> Hi,
>
[quoted text clipped - 44 lines]
>
> Thierry
Shiva[autonomysystems.com] - 03 Aug 2005 11:19 GMT
Hi Virgul,
Uri DocumentUrl = new Uri(thisXDocument.URI);
Provides an object representation of a uniform resource identifier (URI) and
easy access to the parts of the URI
IXMLDOMDocument2 domFormData = null;
An extension of DOMDocument that supports schema caching and validation
features, and switching on XML Path Language (XPath) support.
More information you want look at this below site:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/xmlsdk/html/832
083b0-9400-48eb-aa3c-6447d4b55c91.asp
Other question answer is:
If there is a lot of form in the same directory then we have to set whose
data connection to this dom document from below the statement in C# code.
domFormData = (IXMLDOMDocument2)thisXDocument.GetDOM("FormData");
In this "FormData" specify the data conneciton name.
This connection is receiving data from xml file or webservice or database or
sharepoint.
Hope this helps you.
> Hi,
>
[quoted text clipped - 44 lines]
>
> Thierry
virgul - 03 Aug 2005 14:23 GMT
Hi Shiva,
At first time thanks a lot for your very fast reply!
I'm sorry but I'm not the best for programming and I don't really
understand what you are trying to say me!
For the url (doc and dom too) no type is define what is the type
(Visual studio make me an error)?
url = XDocument.Solution.URI;
url HttpUtility.UrlDecode(url.Substring(url.IndexOf("://")+4)).Replace("/",
"\\");
url = Path.Combine(Path.GetDirectoryName(url), "News Template.xsn");
I don't understand why speak about : Uri DocumentUrl = new
Uri(thisXDocument.URI);
I have understand the answer for the second question!
Like I say I'm not the best and I speak French so sorry if this
question is strange but can you give more explanation?
Thanks a lot in advance!
++
Thierry
virgul - 08 Aug 2005 13:29 GMT
Hi,
I have understand now thanks for your help
++
Thierry