I think I understand what you mean, but I just want to make sure.
If I have already mapped a custom XML to my document, then each of the content controls has a tag, Xpath, itemID and all that associated with it. I got all this by going through my template, giving the fields tags, and doing the mapping myself. Since this is already done, I could now use the setNodeValueAtXPath() function to change the value of any and all fields in the document, provided I somehow supply those itemID's and Xpath values, etc. This is a viable solution if my itemID's never change, right? In other words, I always know that the field Name for the CustomXML is going to map to itemID={FF1A9384-B406-488E-8E72-B61DABF0AA39} and the associated Xpath and Prefix mapping. Is there a way to only use the field's Tag info, so that if the Template changes, but the tags all stay the same, the injection of the custom data still works? As I just described seems like it would really only be best if the template was always going to be the same, right?
That all being said - is that what you meant by the second part of your comments - about injecting an entire customXML into my document? If I have written some Java to marshal objects to XML so that I get something like this for the employee object, lets say:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<employee>
<code>CA</code>
<name>Cath</name>
<salary>300</salary>
</employee>
Then what's enclosed by the salary tags there maps to the field called "salary" in my document, right? The customXML knows nothing of the namespace, XPath, or ID. Would that work? I suspect not, right, because I would still have to go into the Content Control toolkit and make the mapping from "salary" to the salary content control box int he document, right? I am basing this off of the info I got here:
http://blogs.msdn.com/b/modonovan/archi ... 04704.aspxOne final question, lets pretend this template is for Employees at a company. I want each employee to tell me their previous employers. For some this will be none, and for some this will be up to 10, lets say. Each previous employer has a set of similar fields - name, addresss, dates served, position title.
What is the best way to inject this into the template for each employee when I dont know ahead of time how many of these there will be in the document? Would it be best to not even use a content control here, and just generate the XML to output the text strings I have holding this info, in the style I want it, directly into the document? This way I would have a loop over the previous employers, and just output all of the data as I want it - kind of a "manual content control" or is there a way to inject the same fields over and over again with different data each time?