Dirar Abu Kteish
asked on
Load xml with asp extension
Hi,
I am trying to load an xml file with asp extension, i.e sqlXml.load("path/myfile.a sp")... It's working fine when the extension is xml, but I have problem loading it with asp extension.
I know that the problem is because I am trying to load the asp file from a physical path and not through HTTP, but I am not sure how to load the xml from HTTP cuz I am loading the xml from global.asa and the path is not always the same...
appreciate any help
Thanks
I am trying to load an xml file with asp extension, i.e sqlXml.load("path/myfile.a
I know that the problem is because I am trying to load the asp file from a physical path and not through HTTP, but I am not sure how to load the xml from HTTP cuz I am loading the xml from global.asa and the path is not always the same...
appreciate any help
Thanks
So, why change the extension from .xml to .asp? Leave it alone!
before the
sqlXml.load("path/myfile.a sp")
put
sqlXml.setProperty "ServerHTTPRequest", true
and make sure you include the http://mydomain.com/mypath/to/the/asp/file.asp
sqlXml.load("path/myfile.a
put
sqlXml.setProperty "ServerHTTPRequest", true
and make sure you include the http://mydomain.com/mypath/to/the/asp/file.asp
Yeah, but if it ain't broke, why fix it?
i think what he is saying is that he has tried using a xml file and it works but as soon as he tried to create a dynamic XML file with ASP it doesnt work, but he knows for the ASP to execute correctly it has to be called via http
b
b
gotcha - well, until we hear back from dxz2, we won't know what he is thinking ;-)
ASKER
Hi,
I will try B_Dorsey suggestion tomorrow at work.
Why changing xml to asp? because there is sensitive data inside the xml file and I created some kind of server side authentication to disable xml file to be directly viewed in browsers
B_Dorsey what do you mean by "and make sure you include the http://mydomain.com/mypath/to/the/asp/file.asp"
Thanks
-dirar
I will try B_Dorsey suggestion tomorrow at work.
Why changing xml to asp? because there is sensitive data inside the xml file and I created some kind of server side authentication to disable xml file to be directly viewed in browsers
B_Dorsey what do you mean by "and make sure you include the http://mydomain.com/mypath/to/the/asp/file.asp"
Thanks
-dirar
>> cuz I am loading the xml from global.asa
That is pretty secure, no?
That is pretty secure, no?
ASKER
Hi B_Dorsey,
This is what I am doing:
Set sqlXml = Server.CreateObject("MSXML 2.FreeThre adedDOMDoc ument.3.0" )
path = Server.MapPath("../../xml/ DBQUERY.xm l")
sqlXml.setProperty "ServerHTTPRequest", true
sqlXml.load path
did not work
I then added:
sqlXml.async = false
sqlXml.validateOnParse = false
And it worked
Thanks a lot the sqlXml.setProperty was I am missing
This is what I am doing:
Set sqlXml = Server.CreateObject("MSXML
path = Server.MapPath("../../xml/
sqlXml.setProperty "ServerHTTPRequest", true
sqlXml.load path
did not work
I then added:
sqlXml.async = false
sqlXml.validateOnParse = false
And it worked
Thanks a lot the sqlXml.setProperty was I am missing
ASKER
:) my bad I am sorry
no it didn't work till now I thought I changed the path
should be
path = Server.MapPath("../../xml/ DBQUERY.as p")
any suggestions
no it didn't work till now I thought I changed the path
should be
path = Server.MapPath("../../xml/
any suggestions
a ASP page needs to be executed.. I didnt know you could use ../ in Server mappath... so try the suggestions below...
Set sqlXml = Server.CreateObject("MSXML 2.FreeThre adedDOMDoc ument.3.0" )
sqlXml.setProperty "ServerHTTPRequest", true
sqlXml.Load Server.MapPath("/xml/DBQUE RY.asp")
Set sqlXml = Server.CreateObject("MSXML 2.FreeThre adedDOMDoc ument.3.0" )
sqlXml.setProperty "ServerHTTPRequest", true
sqlXml.Load Server.MapPath("http://www.mydomain.com/xml/DBQUERY.asp") 'Replace my domain with the domain name
Set sqlXml = Server.CreateObject("MSXML
sqlXml.setProperty "ServerHTTPRequest", true
sqlXml.Load Server.MapPath("/xml/DBQUE
Set sqlXml = Server.CreateObject("MSXML
sqlXml.setProperty "ServerHTTPRequest", true
sqlXml.Load Server.MapPath("http://www.mydomain.com/xml/DBQUERY.asp") 'Replace my domain with the domain name
ASKER
I get "Invalid xml declaration" I think this is because of the <%%> in asp
-dirar
-dirar
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
ASKER
I gad to start the document with
<?xml version="1.0" encoding="utf-8"?>
instead with <%%>
and it worked
thanks
<?xml version="1.0" encoding="utf-8"?>
instead with <%%>
and it worked
thanks