Proceed to WirelessDevNet Home Page
Publications, e-books, and more! Community Tutorials Store Downloads, tools, & Freebies! IT Career Center News Home
newnav.gif

Newsletters
EMail Address:



   Content
  - Articles
  - Columns
  - Training
  - Library
  - Glossary
 
   Career Center
  - Career Center Home
  - View Jobs
  - Post A Job
  - Resumes/CVs
  - Resource Center
 
   Marketplace
  - Marketplace Home
  - Software Products
  - Wireless Market Data
  - Technical Books
 
   News
  - Daily News
  - Submit News
  - Events Calendar
  - Unsubscribe
  - Delivery Options
 
   Community
  - Discussion Boards
  - Mailing List
  - Mailing List Archives
 
   About Us
  - About WirelessDevNet
  - Wireless Source Disks
  - Partners
  - About MindSites Group
  - Advertising Information
 
INDEX
>Introduction
>Dissecting The ASP Document
>Dissecting The XSL Stylesheet
>Conclusion

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 "<?xml version=""1.0"" ?>" Response.Write "<!DOCTYPE wml PUBLIC ""-//WAPFORUM//DTD " & _ "WML 1.1//EN"" ""http://www.wapforum.org/DTD/wml_1.1.xml"">"

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

Sponsors

Search

Eliminate irrelevant hits with our industry-specific search engine!









Wireless Developer Network - A MindSites Group Trade Community
Copyright© 2000-2010 MindSites Group / Privacy Policy
Send Comments to:
feedback@wirelessdevnet.com