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="1.0" ?>
- <cds xmlns:sql="urn:schemas-microsoft-com:xml-sql">
- <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
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="1.0" ?>
- <cds xmlns:sql="urn:schemas-microsoft-com:xml-sql">
- <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