Hallo Patrick,
great, I will try to explain.
Background:
The form in this case deals with Product Test Reports. The test and the results are described by the user, as he fills out the form. For instance, what happens, if I let a product fall from one Meter off the table, and so on. Over the months and years we developed the form template further to meet the needs for the R&D-Department, so I am currently developing version 6 of the form template. Very often these test are the same or very similar, so the User saves time. In some way the form would present the users with possible older test reports, he selects one and the new routine would get him the data and save the NEW form. I used to have this function in a way, where I would open the older form with InfoPath and just give it a new unique id and filename and save it, but we had to disable this function, because it only works, if the xml-Schema hasn't changed with the new version. Also bugfixes and new functions do not nesseccarily apply.
This is why I came up with the idea to go from the new version "back in time" and retrieve the old data and copy it into my new/changed Schema. Of course the new form can know what xpath to look on in the old forms and of course the old cannot know about the later version schema.
Function:
The user basically provides an ID, that the form can resolve to a filepath. All old forms are stored at known formlibrary that serves somewhat as an archive for this matter.
Qrules would take this filepath and paste it at the FileDataConnection.
Then I would Query this dataconnection and have the old form accessable.
I must then know what version the old form is based on, so I would need to be able to read the solutionversion number and I think I need to read this href-attribute, that references the template. The template is somewhat more accurate for me, because sometimes I forgot to increase the main version number. I would extraxt the "v1" for instance out of the URL.
Example XML Header for version 1
<?xml version="1.0"?><?mso-infoPathSolution productVersion="11.0.8034" PIVersion="1.0.0.0" href="http://intranet.weinmann.com/FormServerTemplates/Versuchsbericht%20v1.xsn" name="urn:schemas-microsoft-com:office:infopath:Versuchsberichte:-myXSD-2006-07-19T05-45-18" solutionVersion="1.1.0.254" ?><?mso-application progid="InfoPath.Document"?><?MicrosoftWindowsSharePointServices ContentTypeID="0x0101010041703ADC4E294E468EDFA6E7C3F3AF6100AF98C44E75D75F4DAE463F64D90F8683"?>
Example XML Header for version 5
<?xml version="1.0"?><?mso-infoPathSolution productVersion="12.0.0" PIVersion="1.0.0.0" href="http://intranet.weinmann.com/FormServerTemplates/Versuchsbericht%20v5.xsn" name="urn:schemas-microsoft-com:office:infopath:Versuchsbericht-v5:-myXSD-2008-05-30T12-44-41" solutionVersion="1.1.5.3" ?><?mso-application progid="InfoPath.Document" versionProgid="InfoPath.Document.2"?><?MicrosoftWindowsSharePointServices ContentTypeID="0x01010100EA10D9D32CF7C14BBDD1779D99B21DA100C8138EAB883DB242ABD47A1E476948D4"?>
When I know which template I am dealing with, I know the xpaths and can access with absolute accurance and finally copy them.
A lot of it is Rich Text, so I need to accurately copy the InnerXML. At this point I need to rely on your expertise, because I cannot explain very well. The old richtextField contains usually pictures, links, formatting, tables. All of this I need to copy!
Attachments the old form has I also would like to be able to copy.
Most of the old forms are digitally signed, but I think that does'nt matter, does it. The signature should be just annother field with a hashcode or something. I DO NOT need to copy the old signature info, it would be broken anyway.
So, I think this is about it. Maybe you have further ideas, when you abstract my feature wish and make it more general?
If you have any more questions, please let me know. I am really looking forward to this.
Best regards
Michael