populate node from secondary (XML) data source

W

will.horn

My main data source has a group that I would like to prepopulate from
my secondary data source (referencedata.xml) when the form loads.

I'm not too familiar with JScript, but this is what I've tried:

XDocument.DataObjects("referencedata").QueryAdapter.Query(); // is
this needed?
var refdata = XDocument.GetDOM("referencedata");

var runs = XDocument.DOM.selectSingleNode("//runs");
runs = refdata.selectSingleNode("//runs");

I think the problem is in the last line since in the debugger, refdata
looks like it's is loaded correctly. Can I not simply copy nodes like
this? Is there another function I need to use?

Thanks,
Will
 
W

Will

If anyone is interested, the replaceChild function worked:

var runs = XDocument.DOM.selectSingleNode("//runs");
var refruns = refdata.selectSingleNode("//runs");
XDocument.DOM.selectSingleNode("//runData").replaceChild(refruns, runs);
 

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

Top