This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Java Interview Guide and have Anthony DePalma on-line!
See this thread for details.
The moose likes XML and Related Technologies and the fly likes problem of transforming XML to WML Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "problem of transforming XML to WML" Watch "problem of transforming XML to WML" New topic

problem of transforming XML to WML

Waldle Cai
Ranch Hand

Joined: Aug 16, 2000
Posts: 34
hi all,
When I tried to use Xalan XSLT to transform a XML file to WML, it gave me something funy. Here is the detail:
command line: java org.apache.xalan.xslt.Process -IN hello.xml -XSL hello.xsl -OUT hello.wml
hello.xml file:
<?xml version="1.0"?>
hello.xsl file:
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="" version="1.0">
<xsl:template match="/">
<xsl:value-of select="doc"/>
<?xml version="1.0" encoding="UTF-8"?>
The question is why the transformer converts "<!DOCTYPE" to "<!DOCTYPE"?
I have to get it right otherwise my WAP browser will complain.
Thanks and Regards
Mapraputa Is
Leverager of our synergies

Joined: Aug 26, 2000
Posts: 10065

Cannot understand what is wrong with <!DOCTYPE -> <!DOCTYPE conversion. My guess is that transformer simply output your CDATA section. Anyay, if it's not what you want, you can probably use "<xsl:output" element for coding your DOCTYPE declaration:
<xsl:output doctype-public="aString" doctype-system="anotherString"/>

[This message has been edited by Mapraputa Is (edited May 17, 2001).]

Uncontrolled vocabularies
"I try my best to make *all* my posts nice, even when I feel upset" -- Philippe Maquet
Waldle Cai
Ranch Hand

Joined: Aug 16, 2000
Posts: 34
sorry, i made a typing mistake.
My question was why "<!DOCTYPE" was transformed into "<DOCTYPE", which is not what i want.
But I know the answer now. I have to use <xsl.text disable-output-escaping="yes" to disable the escaping. Only using CDATA is not enough.
Jim Baiter
Ranch Hand

Joined: Jan 05, 2001
Posts: 532
This link has some good detail about XML->WML
I agree. Here's the link:
subject: problem of transforming XML to WML
It's not a secret anymore!