Transforming XML into WML (cont.)
Dissecting The ASP Document
We first look at the ASP document that performs the transformation.
First, we create an instance of the DOM object using the MSXML3 and load up the XML document:
|
Set xml = Server.CreateObject("MSXML2.DOMDocument")
xml.async = false
xml.load (Server.MapPath("XMLCourse.xml"))
|
Next we create another instance of the DOM object to load the XSL stylesheet, since an XSL stylesheet is also an XML document:
|
Set xsl = Server.CreateObject("MSXML2.DOMDocument")
xsl.async = false
xsl.load (Server.MapPath("WML.xsl"))
|
We then prepare to send the MIME type for WML content and also the WML prologue:
|
Response.ContentType = "text/vnd.wap.wml"
Response.Write ""
Response.Write ""
|
Once the MIME type and the prologue have been sent, we use the transformNode() method to perform the transformation.
|
Response.write (xml.transformNode(xsl))
%>
|
That's it! The XML document will then be transformed into WML and the WML content would be sent to the WAP emulator. I will
talk about the MSXML3 in more details in subsequent articles.
Next: Dissecting The XSL Stylesheet