File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "XML to WML" Watch "XML to WML" New topic
Author

XML to WML

Reeti Saha
Ranch Hand

Joined: Jun 26, 2001
Posts: 34
Hi:
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
/wml_1.1.xml">
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.
Regards
Reeti
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"
version="1.0">
<xsl:template match="xsl utput">
<xsl:copy>
<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:attribute>
</xsl:copy>
</xsl:template>
<xsl:template match="page">
<wml>
<card title="{@title}">
<xsl:apply-templates/>
</card>
</wml>
2. second one is you have to embed the DOCTYPE Delcaration in CDATA in your .xsl file.
Pls try it out.
Tks
Jowsaki
Reeti Saha
Ranch Hand

Joined: Jun 26, 2001
Posts: 34
Thanks.
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"
indent="yes"
encoding="UTF-8"
doctype-public="-//WAPFORUM//DTD WML 1.1//EN"
doctype-system="http://www.wapforum.org/DTD/wml_1.1.xml"/>
Regards
Reeti Saha
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: XML to WML