There's an excellent article here about outputting nested xml but this is not quite my situation (although I may need to take this approach).
I have a fairly complex nested xml structure that I must conform to in order to send data (government thing).
What I'm doing is reading in blank xml shell into a dataset. If I immediately write again, the nesting structure is fine.
The tables are all there after the read and it looks good, but as soon as I add a record, the node is added at the root and the nesting structure is broken. I loop through all the relations and set Nesting = true immediately after reading, but no luck.
The problem is that the structure I need to submit doesn't contain the key fields to set up the "normal" parent-child relationships. Do I need to recreate the relationships and maybe hide them on output? Or is there another way?
Eg:
<school>
<student>
<name>John Smith </name>
</student>
</school>
As soon as I add a record to the student table and write the file, the student node moves down to the school level???