simonB2006
Programmer
k, so I was retrieving a standard xml file with the ASP code in 'reader.asp' (below) .. works fine.
Then instead of having a fixed xml file, i wanted to generate the xml from another .asp script, so I created 'dynamicXML.asp' (also below) to generate xml.
When i view 'dynamicXML.asp' direclty in the browser it displays as a proper XML file. However, when i point 'reader.asp' at it ... nothing happens !!
Does anyone know why my reader.asp will not read the xml output of my dynamic xml page ??
Many thanks !!
------------------ reader.asp ----------------------
<%
Set objXML = Server.CreateObject("Microsoft.XMLDOM")
objXML.async = False
objXML.Load (Server.MapPath("xmlSample.xml"))
Set objLst = objXML.getElementsByTagName("*")
StrFieldname = ""
StrFieldvalue = ""
For i = 0 to (objLst.length - 1)
StrFieldname = StrFieldname & " : " & objLst.item(i).nodeName
' StrFieldvalue = StrFieldvalue & " : " & objLst.item(i).text
Next
response.write StrFieldname
%>
------------- dynamicXML.asp ----------------------
<%
' --- generate s_out from script -- '
s_out = "<?xml version='1.0'?><Order><Account>123</Account><Item id='1'><SKU>1234</SKU><PricePer>5.95</PricePer><Quantity>100</Quantity><Subtotal>595.00</Subtotal><Description>Super Widget Clamp</Description></Item></Order>"
response.ContentType="text/xml"
Response.write s_out
%>
Then instead of having a fixed xml file, i wanted to generate the xml from another .asp script, so I created 'dynamicXML.asp' (also below) to generate xml.
When i view 'dynamicXML.asp' direclty in the browser it displays as a proper XML file. However, when i point 'reader.asp' at it ... nothing happens !!
Does anyone know why my reader.asp will not read the xml output of my dynamic xml page ??
Many thanks !!
------------------ reader.asp ----------------------
<%
Set objXML = Server.CreateObject("Microsoft.XMLDOM")
objXML.async = False
objXML.Load (Server.MapPath("xmlSample.xml"))
Set objLst = objXML.getElementsByTagName("*")
StrFieldname = ""
StrFieldvalue = ""
For i = 0 to (objLst.length - 1)
StrFieldname = StrFieldname & " : " & objLst.item(i).nodeName
' StrFieldvalue = StrFieldvalue & " : " & objLst.item(i).text
Next
response.write StrFieldname
%>
------------- dynamicXML.asp ----------------------
<%
' --- generate s_out from script -- '
s_out = "<?xml version='1.0'?><Order><Account>123</Account><Item id='1'><SKU>1234</SKU><PricePer>5.95</PricePer><Quantity>100</Quantity><Subtotal>595.00</Subtotal><Description>Super Widget Clamp</Description></Item></Order>"
response.ContentType="text/xml"
Response.write s_out
%>