C
cmt
Greetings everyone,
I'm building an XML document based on data from a bunch of SQL
queries. The queries call data from multiple tables...not just one.
It feels as if the method I am using is cumbersome and I am wondering
if there is a better method.
Currently I am just building the XML document like this:
This is just an example version. The actual code is about 1000 lines
long.
Does ASP have a better way of handling the creation of XML?
Thanks!
I'm building an XML document based on data from a bunch of SQL
queries. The queries call data from multiple tables...not just one.
It feels as if the method I am using is cumbersome and I am wondering
if there is a better method.
Currently I am just building the XML document like this:
Code:
SQL1 'SQL query 1
Set rs1 = conn.Execute(SQL1)
If Not (rs1.EOF = True And rs1.bof = True) Then
Set inode = xmldoc.createNode("element", "fielda, "")
onode.appendChild (inode)
Set child = xmldoc.createNode("element", "fieldb", "")
child.Text = rs1.fields(0)
inode.appendChild (child)
Set child = xmldoc.createNode("element", "fieldc", "")
child.Text = rs1.fields(1)
inode.appendChild (child)
SQL2 'SQL query 2
Set rs2 = conn.Execute(SQL2)
If Not (rs2.EOF = True And rs2.bof = True) Then
Set inode = xmldoc.createNode("element", "fielda", "")
onode.appendChild (inode)
Set child = xmldoc.createNode("element", "fieldb", "")
child.Text = rs2.fields(0)
inode.appendChild (child)
Set child = xmldoc.createNode("element", "fieldc", "")
child.Text = rs2.fields(1)
inode.appendChild (child)
SQL3 'SQL query 3
Set rs3 = conn.Execute(SQL3)
If Not (rs3.EOF = True And rs3.bof = True) Then
Set inode = xmldoc.createNode("element", "fielda", "")
onode.appendChild (inode)
Set child = xmldoc.createNode("element", "fieldb", "")
child.Text = rs3.fields(0)
inode.appendChild (child)
Set child = xmldoc.createNode("element", "fieldc", "")
child.Text = rs3.fields(1)
inode.appendChild (child)
This is just an example version. The actual code is about 1000 lines
long.
Does ASP have a better way of handling the creation of XML?
Thanks!