• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

problem of transforming XML to WML

 
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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"?>
<doc>Hello</doc>
hello.xsl file:
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:template match="/">
<![CDATA[
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/DTD/wml_1.1.xml">
]]>
<wml>
<card>
<p>
<xsl:value-of select="doc"/>
</p>
</card>
</wml>
</xsl:template>
</xsl:stylesheet>
hello.wml:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/DTD/wml_1.1.xml">
<wml><card><p>Hello</p></card></wml>
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
Waldle
 
Leverager of our synergies
Posts: 10065
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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).]
 
Waldle Cai
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Ranch Hand
Posts: 532
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This link has some good detail about XML->WML
http://www.wirelessdevnet.com/channels/wap/training/xslt_wml.html
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic