Altova Mailing List Archives>Archive Index >microsoft.public.xml Archive Home >Recent entries >Thread Prev - Re: Newbie problems . . . >Thread Next - Re: Newbie problems . . . Re: Newbie problems . . .To: NULL Date: 10/17/2008 12:58:00 PM Martin Honnen wibbled:
> Buzby wrote:
>
> > > Why do you try that? Can't you simply use xmlhttp.responseXML as
> > > the input document for your transformation?
> >
> > I though thats what "xml.loadxml(xmlhttp.responseText) " did!?
>
> The MSXML request object already exposes a responseXML property so
> there is usually no need to parse responseText, that does not gain
> you anything. Use responseXML as the input e.g. processor.input =
> xmlhttp.responseXML
Please bear with with me on this one - as I said I'm new to all this
and am struggling!
Ok code now as follows:-
--
Set xml = Server.CreateObject("MSXML2.FreeThreadedDOMDocument.3.0")
xml.async = false
xml.loadXml(xmlhttp.responseXML.xml)
Set xsl = Server.CreateObject("MSXML2.FreeThreadedDOMDocument.3.0")
xsl.async = false
xsl.load (Server.MapPath("/xsl/test2.xsl"))
Set template = Server.CreateObject("MSXML2.XSLTemplate")
template.stylesheet = xsl
set processor = template.createProcessor()
processor.input = xml
' name parameters
If city <> "" Then processor.addParameter "city", city
'Transform
processor.transform()
Response.write (processor.output)
--
xmlhttp.responseXML.xml returns the following xml which looks correct
to me:
--
<?xml version="1.0"?>
<!DOCTYPE respuesta SYSTEM
"http://www.hotelresb2b.com/xml/dtd/res_paises.dtd">
<respuesta>
<tipo><![CDATA[5]]></tipo>
<nombre><![CDATA[Paises]]></nombre>
<agencia><![CDATA[BOOK THIS ROOM]]></agencia>
<parametros>
<paises>
<pais>
<codigo_pais><![CDATA[AI]]></codigo_pais>
<nombre_pais><![CDATA[ALBANIA]]></nombre_pais>
</pais><pais>
<codigo_pais><![CDATA[AL]]></codigo_pais>
<nombre_pais><![CDATA[ALEMANIA]]></nombre_pais>
</pais><pais>
<codigo_pais><![CDATA[AN]]></codigo_pais>
<nombre_pais><![CDATA[ANDORRA]]></nombre_pais>
</pais>
</paises>
</parametros>
</respuesta>
--
When I run this transformation I'm getting the following error:
Error parsing XML file:No data is available for the requested resource.
[http://www.hotelresb2b.com/xml/dtd/res_paises.dtd: line 0, col 0]
All help, pointers abuse etc gratefully recieved!
Thanks
--
Buzby
There's nothing more dangerous than a resourceful idiot
| ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
