Writing to XML

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2016-02-02 06:06 AM
2016-02-02
06:06 AM
regardless of the RecordID I use the new element is always placed on the same line as the position descriptor rather than its own line.
this is the basic structure of the XML ("---" are there just to show the structure because this forum wasn't recognizing the tabs or spaces)
<?xml version="1.0" encoding="UTF-8"?>
<dataroot>
---<Model>
------<name>Config 01</name>
------<x>0.48</x>
------<y>0.24</y>
------<z>0.8</z>
---</Model>
---<Model>
------<name>Config 02</name>
------<x>0.24</x>
------<y>0.48</y>
------<z>0.4</z>
---</Model>
</dataroot>
I want to copy the last "Model" and place in below and then modify its properties (x,y,z). I have tried different position descriptors and all of the "AsLastChild", "AsPreviousSibling" and so on statements but i always end up with something like this.
<dataroot>
---<Model>
------<name>Config 01</name>
------<x>0.48</x>
------<y>0.24</y>
------<z>0.8</z>
---</Model>
---<Model>
------<name>Config 02</name>
------<x>0.24</x>
------<y>0.48</y>
------<z>0.4</z>
---<Model>
------<name>Config 02</name>
------<x>0.24</x>
------<y>0.48</y>
------<z>0.4</z>
---</Model></Model>
</dataroot>
I have tried more basic functions but no matter what it always end up on the same line as the position descriptor
0 REPLIES 0