wood burning stoves*
The moose likes XML and Related Technologies and the fly likes XML to WML Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "XML to WML" Watch "XML to WML" New topic


Reeti Saha
Ranch Hand

Joined: Jun 26, 2001
Posts: 34
While I'm trying to generate wml from a XML and XSL file using Xalan then the wml file that it is creating is not working on a wap enabled browser.
The wml file doesn't contain the line:
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/DTD
I think there is some problem in my xsl file.
Whether anyone can provide me a sample xsl file for doing the same.
It's urgent.
Sham Jowsaki
Ranch Hand

Joined: May 22, 2001
Posts: 146
Hi reeti,
There are 2 ways you can rectify this problem.
1. The first one is your .xsl coding should be like below
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
<xsl:template match="xsl utput">
<xsl:attribute name="method">xml</xsl:attribute>
<xsl:attribute name="doctype-public">-//WAPFORUM//DTD WML 1.1//EN</xsl:attribute>
<xsl:attribute name="doctype-system">http://www.wapforum.org/DTD/wml_1.1.xml
<xsl:template match="page">
<card title="{@title}">
2. second one is you have to embed the DOCTYPE Delcaration in CDATA in your .xsl file.
Pls try it out.
Reeti Saha
Ranch Hand

Joined: Jun 26, 2001
Posts: 34
I'd tried with CDATA but somehow I cldn't make it work.
I've solved the problem by inserting these lines in my xsl file:
<xsl utput method="xml"
doctype-public="-//WAPFORUM//DTD WML 1.1//EN"
Reeti Saha
It is sorta covered in the JavaRanch Style Guide.
subject: XML to WML
Similar Threads
.. XML transformation ..
Getting from server to the phone
can I decide how many bytes I want to show in xslt?
problem of transforming XML to WML
OTA download problem