Gentlemen, thanks again for your continued attention to this issue. I think that either I'm confused about what works or does not work, or you're confused about what I'm asking about. I'm happy to volunteer to be the one that is confused!
But if I'm not confused, then either your statements and documentation is correct and there is a bug in your implementation of XML parsing / templating, or the statements and documentation is wrong and your APIs only accept a very limited subset of XML with substantial constraints on element names. If the former is true, fixing the bug would really help me out, so I'm trying to give you as much information as I can.
Both your messages and the documentation say that Mail Merge APIs accept simple XML data that is enclosed by a tag, and where the XML tags match merge field names.
For example, when I try to upload the the following simple XML data to the execute template API, it is rejected with an HTTP 400 status code and the message: The same table \'signatories\' cannot be the child table in two nested relations.
<?xml version="1.0" encoding="utf-8"?>
Heisenberg Productions
Walter White
Jesse Pinkman
Los Pollos Hermanos
Gustavo Fring
Mike Ehrmantraut
In other words, the Mail Merge APIs do not accept all XML data in the simple XML format that matches your two requirements. There is an additional requirement in the current implementation, which my experimentation thus far indicates is something like:
- If your XML contains an element named A, and
- A contains multiple elements named B, then
- No element named B may be repeated more than once in any other element in the entire XML stream other than within additional A's which are the sibling of the first A.
For a simpler example, this XML works:
<?xml version="1.0" encoding="utf-8"?>
Value
Value
Value
Value
And this XML works:
<?xml version="1.0" encoding="utf-8"?>
Value
Value
Value
But this XML, which satisfies the rules you provided earlier, does not work:
<?xml version="1.0" encoding="utf-8"?>
Value
Value
Value
Value