RE: [xsl] serverside tranformation of xml into wml using asp

Subject: RE: [xsl] serverside tranformation of xml into wml using asp
From: "Andrew Welch" <andrew@xxxxxxxxxxxxxxxxxxxxxxx>
Date: Fri, 6 Apr 2001 14:37:50 +0100
FYI

It seems the problem was the namespace I was using, thanks to Ivan Towlson
for that.

The server is running msxml2.5 so I have reverted back to using the old
namespace until they sort themselves out and get v3.

thanks


-----Original Message-----
From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx
[mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx]On Behalf Of Andrew Welch
Sent: 06 April 2001 13:42
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: [xsl] serverside tranformation of xml into wml using asp


Hi,

This may not be an XSL question at all, if so I apologise in advance, but
something strange is going on...

I have an xml file called categories, that gets transformed into either html
or wml depending on the client.  The clientside transformation works fine,
but the serverside transformation fails to pick out any of the xml data.  If
I transform the xml with same stylesheet using javascript on IE5, it all
works fine. Surely the stylesheet will transform the xml in exactly the same
way regardless of whether its done on the client or on the server??

The xml file looks like:

<?xml version="1.0"?>
<TBD>
  <category>
    <name>Health</name>
    ...
  </category>
</TBD>


The stylesheet to transform it into wml looks like: (It simply takes the
name and makes a link by appending .wml on the end)

<?xml version="1.0" ?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
version="1.0">
<xsl:output omit-xml-declaration="yes"/>
<xsl:template match="/">
 <wml>
  <card id="index" title="-The Bristol Dir-" newcontext="true">
    <p>
    Select:</br>
    <xsl:apply-templates/>
    </p>
  </card>
  </wml>

</xsl:template>

<xsl:template match="TBD/category">
   <a><xsl:attribute name="href"><xsl:value-of
select="name"/>.wml</xsl:attribute><xsl:value-of select="name"/></a><br/>
</xsl:template>

</xsl:stylesheet>

The asp used to perform the transformation looks like:
<% Response.Buffer = True %>
<%
   Dim xml
   Dim xsl

   Set xml = Server.CreateObject("Microsoft.XMLDOM")
   xml.async = false
   xml.load (Server.MapPath("categories.xml"))

   Set xsl = Server.CreateObject("Microsoft.XMLDOM")
   xsl.async = false
   xsl.load (Server.MapPath("wapindex.xsl"))

   Response.ContentType = "text/vnd.wap.wml"
   Response.Write "<?xml version=""1.0"" ?>"
   Response.Write "<!DOCTYPE wml PUBLIC ""-//WAPFORUM//DTD " & _
                  "WML 1.1//EN""
""http://www.wapforum.org/DTD/wml_1.1.xml"";>"

   Response.Write (xml.transformNode(xsl))
%>

The output from a wap emulator is:
-The Bristol Dir-
Select:

.wml

So the XSL seems to not be able to extract any info from the xml, however
the very same stylesheet used in a clientside transformation picks
everything out fine.  I believe the server its running on is using msxml2.5.

Please help

thanks

andrew


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list



 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread