PDA

View Full Version : Output to XML format



tnayfeh
06-01-2007, 06:30 AM
My output to XML function seems to be working but I'm stuck on the formatting of the file.....I'm trying to add a carriage return for each node, my code looks like this:

xmldoc.documentElement.appendChild (onode2)
Set inode2 = xmldoc.createNode("element", "platformUser", "")
inode2.setAttribute "platformCode", "COG"
inode2.setAttribute "lid", rs2.fields(1)
inode2.setAttribute "platformUserName", rs2.fields(1)
inode2.setAttribute "appUserName", rs2.fields(0)
onode2.appendChild (inode2)

while the output looks like:

<platformUser platformCode="COG" lid="aroraa5" platformUserName="aroraa5" appUserName="User, Test">
<privilegeCode>CPG</privilegeCode>
<privilegeCode>ED</privilegeCode>
<privilegeCode>MB</privilegeCode>
</platformUser>

So for each <platformUser>...</platformUser> there should be a line. Is this easy to do?

Thanks so much in advance!
TN

mattj
06-01-2007, 06:39 AM
See http://tek-tips.com/viewthread.cfm?qid=1372353&page=1 - it might help...

tnayfeh
06-01-2007, 06:56 AM
Perfect! Thanks for you help mattj.

mattj
06-01-2007, 07:01 AM
Glad I could help!