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="1.0" encoding="UTF-8"?>
<!--
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="1.0" xmlns:xsl=" xmlns:xsi=" <xsl
utput method="xml" encoding="UTF-8"/>
<xsl:template match="/sport">
<HorseRacingCard>
<xsl:for-each select="eventgroup">
<xsl:variable name="V2" select="."/>
<Meeting>
<xsl:for-each select="@name">
<xsl:attribute name="course">
<xsl:value-of select="."/>
</xsl:attribute>
</xsl:for-each>
<xsl:for-each select="$V2/event">
<xsl:for-each select="@eventdate">
<xsl:attribute name="date">
<xsl:value-of select="."/>
</xsl:attribute>
</xsl:for-each>
</xsl:for-each>
<xsl:for-each select="event">
<Race>
<xsl:for-each select="@eventtime">
<xsl:attribute name="time">
<xsl:value-of select="."/>
</xsl:attribute>
</xsl:for-each>
<xsl:for-each select="@name">
<Title>
<xsl:value-of select="."/>
</Title>
</xsl:for-each>
</Race>
</xsl:for-each>
<Race>
<Horse>
<xsl:for-each select="$V2/event">
<xsl:for-each select="market">
<xsl:for-each select="selection">
<xsl:for-each select="name">
<xsl:attribute name="name">
<xsl:value-of select="."/>
</xsl:attribute>
</xsl:for-each>
</xsl:for-each>
</xsl:for-each>
</xsl:for-each>
<xsl:for-each select="$V2/event">
<xsl:for-each select="market">
<xsl:for-each select="selection">
<xsl:for-each select="tmplnum">
<Cloth>
<xsl:value-of select="."/>
</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("MSXML2.DOMDOCUMENT"
Set xml = Server.CreateObject("MSXML".DOMDOCUMEMNT"
' Opens the connection to the remote server.
objXMLhttp.Open "GET", " False
' Actually Sends the request and returns the data:
objXMLhttp.Send
xml.loadXML(objXMLhttp.responseText)
set xsl = Server.CreateObject("Microsoft.XMLDOM"
xsl.async = false
xsl.load(Server.MapPath("/xml/MapToHorseRacingCard.xslt"
)
Response.Write xml.TransformNode(xsl)
%>
The XML is being delivered to source but not to the browser
Thanks in advance
Nigel
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="1.0" encoding="UTF-8"?>
<!--
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="1.0" xmlns:xsl=" xmlns:xsi=" <xsl
<xsl:template match="/sport">
<HorseRacingCard>
<xsl:for-each select="eventgroup">
<xsl:variable name="V2" select="."/>
<Meeting>
<xsl:for-each select="@name">
<xsl:attribute name="course">
<xsl:value-of select="."/>
</xsl:attribute>
</xsl:for-each>
<xsl:for-each select="$V2/event">
<xsl:for-each select="@eventdate">
<xsl:attribute name="date">
<xsl:value-of select="."/>
</xsl:attribute>
</xsl:for-each>
</xsl:for-each>
<xsl:for-each select="event">
<Race>
<xsl:for-each select="@eventtime">
<xsl:attribute name="time">
<xsl:value-of select="."/>
</xsl:attribute>
</xsl:for-each>
<xsl:for-each select="@name">
<Title>
<xsl:value-of select="."/>
</Title>
</xsl:for-each>
</Race>
</xsl:for-each>
<Race>
<Horse>
<xsl:for-each select="$V2/event">
<xsl:for-each select="market">
<xsl:for-each select="selection">
<xsl:for-each select="name">
<xsl:attribute name="name">
<xsl:value-of select="."/>
</xsl:attribute>
</xsl:for-each>
</xsl:for-each>
</xsl:for-each>
</xsl:for-each>
<xsl:for-each select="$V2/event">
<xsl:for-each select="market">
<xsl:for-each select="selection">
<xsl:for-each select="tmplnum">
<Cloth>
<xsl:value-of select="."/>
</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("MSXML2.DOMDOCUMENT"
Set xml = Server.CreateObject("MSXML".DOMDOCUMEMNT"
' Opens the connection to the remote server.
objXMLhttp.Open "GET", " False
' Actually Sends the request and returns the data:
objXMLhttp.Send
xml.loadXML(objXMLhttp.responseText)
set xsl = Server.CreateObject("Microsoft.XMLDOM"
xsl.async = false
xsl.load(Server.MapPath("/xml/MapToHorseRacingCard.xslt"
Response.Write xml.TransformNode(xsl)
%>
The XML is being delivered to source but not to the browser
Thanks in advance
Nigel