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 biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

XML, XSL, XSLT, RemoteHttp Request and ASP

Status
Not open for further replies.

nigeltoo

Programmer
Nov 22, 2003
1
GB
Hi Guys - I am so stuck this proble is killing me.

1. I have a remote XML file on an http server.
2. I am using ans xslt document to transform the origional xml into a new xml format.
3. I want to sicplay the true xml in a browser but am just getting lines of text.
4. The XSLT was generated in the new XMLSPY MAPFORCE2004 Product.

Can anyone help me PLEASE.

Source XML is at:
XSLT is as follows

<?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?>
<!--

This file was generated by MAPFORCE 2004

YOU SHOULD NOT MODIFY THIS FILE, BECAUSE IT WILL BE
OVERWRITTEN WHEN YOU RE-RUN XSLT GENERATION.

Refer to the MAPFORCE 2004 Documentation for further details.

-->
<xsl:stylesheet version=&quot;1.0&quot; xmlns:xsl=&quot; xmlns:xsi=&quot; <xsl:eek:utput method=&quot;xml&quot; encoding=&quot;UTF-8&quot;/>
<xsl:template match=&quot;/sport&quot;>
<HorseRacingCard>
<xsl:for-each select=&quot;eventgroup&quot;>
<xsl:variable name=&quot;V2&quot; select=&quot;.&quot;/>
<Meeting>
<xsl:for-each select=&quot;@name&quot;>
<xsl:attribute name=&quot;course&quot;>
<xsl:value-of select=&quot;.&quot;/>
</xsl:attribute>
</xsl:for-each>
<xsl:for-each select=&quot;$V2/event&quot;>
<xsl:for-each select=&quot;@eventdate&quot;>
<xsl:attribute name=&quot;date&quot;>
<xsl:value-of select=&quot;.&quot;/>
</xsl:attribute>
</xsl:for-each>
</xsl:for-each>
<xsl:for-each select=&quot;event&quot;>
<Race>
<xsl:for-each select=&quot;@eventtime&quot;>
<xsl:attribute name=&quot;time&quot;>
<xsl:value-of select=&quot;.&quot;/>
</xsl:attribute>
</xsl:for-each>
<xsl:for-each select=&quot;@name&quot;>
<Title>
<xsl:value-of select=&quot;.&quot;/>
</Title>
</xsl:for-each>
</Race>
</xsl:for-each>
<Race>
<Horse>
<xsl:for-each select=&quot;$V2/event&quot;>
<xsl:for-each select=&quot;market&quot;>
<xsl:for-each select=&quot;selection&quot;>
<xsl:for-each select=&quot;name&quot;>
<xsl:attribute name=&quot;name&quot;>
<xsl:value-of select=&quot;.&quot;/>
</xsl:attribute>
</xsl:for-each>
</xsl:for-each>
</xsl:for-each>
</xsl:for-each>
<xsl:for-each select=&quot;$V2/event&quot;>
<xsl:for-each select=&quot;market&quot;>
<xsl:for-each select=&quot;selection&quot;>
<xsl:for-each select=&quot;tmplnum&quot;>
<Cloth>
<xsl:value-of select=&quot;.&quot;/>
</Cloth>
</xsl:for-each>
</xsl:for-each>
</xsl:for-each>
</xsl:for-each>
</Horse>
</Race>
</Meeting>
</xsl:for-each>
</HorseRacingCard>
</xsl:template>
</xsl:stylesheet>


The asp code is

<%@ Language=VBScript %>
<%
Response.Buffer = True
Dim objXMLhttp, xml

' Create an xmlhttp object:
Set objXMLhttp = Server.CreateObject(&quot;MSXML2.DOMDOCUMENT&quot;)
Set xml = Server.CreateObject(&quot;MSXML&quot;.DOMDOCUMEMNT&quot;)


' Opens the connection to the remote server.
objXMLhttp.Open &quot;GET&quot;, &quot; False

' Actually Sends the request and returns the data:
objXMLhttp.Send

xml.loadXML(objXMLhttp.responseText)

set xsl = Server.CreateObject(&quot;Microsoft.XMLDOM&quot;)
xsl.async = false
xsl.load(Server.MapPath(&quot;/xml/MapToHorseRacingCard.xslt&quot;))

Response.Write xml.TransformNode(xsl)
%>

The XML is being delivered to source but not to the browser

Thanks in advance

Nigel
 
Hi,
Have you found out what was going wrong?? I have a similar problem, im storing info in my xml files (treating this as the database) and I have a simple loginpage when when someone inputs their e-mail address, it should then go into the xml. If the e-mail address matches the one in the code then it should push some infor out to the server...

Can you give me any ideas plssss.

Thanks

Riks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top