Hi Matt - thanks for the help, it worked.
I did notice that line of code you mention, but I did not connect the "Vehicles" string in the code with name of the secondary data source. Also, the XDocument.GetDOM(...) only seems to work for secondary data sources. I tried it with "Main" and it returned null. To get the data source for the loaded document you have to use the XDocument.DOM property.
Another thing which has tricked me is the namespace issues when making lookups. My XPath queries into the DOMs did not work until I added a namespace prefix to the queries like this:
// Source nodes
var srcLines = domSrc.selectNodes("/src:Summary/src:line");
The code above only works if the start of the script contains the following namespace definitions. I left out some of the namespaces for brevity:
//<namespacesDefinition>
XDocument.DOM.setProperty("SelectionNamespaces",'... xmlns:src="schema1" ... ');
XDocument.GetDOM("PrintSummary").setProperty("SelectionNamespaces", ' ... xmlns:dest="schema2" ... ');
//</namespacesDefinition>
The DOM for my secondary data source is accessed by the name "PrintSummary".
If you guys have the time I think an article concerning the subject above would help a lot of people.
Thanks again for the tip.
Thomas