This code references the root XML node, adds a FirstXMLObject under it, then adds a few fields under FirstXMLObject:
var myXMLroot = mydocument.xmlElements.item(0); // The root always exists
var b = myXMLroot.xmlElements.add( "FirstXMLObject");
b.xmlElements.add( "Name", "Bob");
b.xmlElements.add( "Address", "1234 Sesame Lane");
Supposedly, the second parameter to "add" is the value of the field. However, when I drag the associated InDesign tag to a document, nothing shows up.
What method or parameter do I set the value of the XML Element so that it links to InDesign? Is there some book that lists these methods and how to use them using JavaScript?
I was able to get InDesign ExtendScript to load MS ASP.NET MVC 2 JSON serialize products to a single JavaScript variable using eval. Now I need to get those products in the XML structure pane.