Win a copy of Succeeding with AI this week in the Artificial Intelligence and Machine Learning forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
  • Junilu Lacar
Sheriffs:
  • Tim Cooke
  • Jeanne Boyarsky
  • Knute Snortum
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:
  • salvin francis
  • fred rosenberger
  • Frits Walraven

want to generate wml file from a xsl file

 
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i want to generate wml file from a xsl file:-
greeting.xml:-
---------------
<?xml version="1.0"?>
<greetings>
<greeting>Hello World</greeting>
</greetings>

greeting.xsl:-
---------------
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; version="1.0">
<xsl: output method="wml"/>
<xsl:template match="/">
<wml>
<card id="greeting" title="Hello World">
<p>
<xsl:apply-templates select="greetings/greeting">
<p>
</card>
</wml>
</xsl:template>
<xsl:template match="greeting">
<xsl:value-of select="."/>
</xsl:template>
</xsl:stylesheet>
***************************
I used the greeting.xml and greeting.xsl to generate greeting.wml file by using two XSLT processors:-
1-Xalan
2-Clark's XT
but unable to generate the wml file from both of them,none of the XLLT processors generate the wml file.
Can anyone help me in generating the wml file using XSLT processor.Plz let me know from which processor i can do this and what will be the procedure.
Thanks in advance
 
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
Here are the changes u need to make in ur xsl file
1.There is no space between 'xsl:' and 'output'
2.u cant have just <p>. u need to use it as <p/> or <p></p>. remember in xml, u cant have tags which are not closed.
3.xsl:apply-templates is not closed.
4. also xsl utput method supports 3 values for its 'method' attribute. html,xml,text. I am not sure if u can have wml. but if u specify 'html' there it will very well generate a wml file the way u wanted. others any insights??
 
passwords must contain 14 characters, a number, punctuation, a small bird, a bit of cheese and a tiny ad.
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic