Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DOM and SQL2000

Status
Not open for further replies.

Torp23

Programmer
Jun 13, 2002
32
0
0
US
My goal is to read an XML file that is created from SQL2000 into a DOM

I am reading the XML and XSL files into seperate DOM objects as follows:
Set source = Server.CreateObject("MSXML2.DOMDocument")
source.async = false
source.load(xmlurl)

Once the DOM objects are defined they are being combined into a text based output as follows:
xmldata = source.transformNode(style)

When I take a text file that has the XML data in it I get the correct result, but when I substitute an XML file that has a "SELECT ... FOR XML xxx" the program does not error (so I suspect that it found the file alright), but I get zero records... it is not reading the data.

Running either XML source file in a browser returns the same format with an additional line at the top of the SQL generated version:
////////////////////////////////////////////////////////////////////
XML TEXT FILE:
- <cds>
- <cd>
<id>152</id>
<title>Tallis/Mass for four voices</title>
<artist>Oxford Camerata cond. Jeremy Summerly</artist>
<genre>classical, choral</genre>
</cd>

XML SQL GENERATED FILE:
<?xml version=&quot;1.0&quot; ?>
- <cds xmlns:sql=&quot;urn:schemas-microsoft-com:xml-sql&quot;>
- <cd>
<id>152</id>
<title>Tallis/Mass for four voices</title>
<artist>Oxford Camerata cond. Jeremy Summerly</artist>
<genre>classical, choral</genre>
</cd>
////////////////////////////////////////////////////////////////////

What do I need to do to get the DOM to recognize the SQL2000 generated file like it successfully does with the text file? Alternately, how can I get the DOM (or some other method) to return the text of the SQL2000 generated file so that I can use it to drop into a text file that the DOM can then successfully read? I would prefer not to use ADO to create this text file.

Scott
 
Thanks for the idea Bryan, I wasn't aware of that command, but when I tried it I get the same effect. Like I said, I think it sees that file, but it is either returning no records or it isn't reading what is being returned.

If I load an XML file into a DOM object (the one that is not being read) and then dump the DOM object contents to html to see what it has, that might be a good test to see if it is even getting the data. If I read the xml in through the statement: &quot;source.loadxml(xmlurl)&quot;, how can I have the DOM do a &quot;response.write source.xmlcontent&quot; or something?

Any other ideas? I am grasping. :( ... Scott
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top