• 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
  • Ron McLeod
  • Liutauras Vilda
  • Paul Clapham
  • paul wheaton
Sheriffs:
  • Tim Cooke
  • Devaka Cooray
  • Rob Spoor
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Carey Brown
  • Mikalai Zaikin
Bartenders:

why is the output not displayed

 
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Source xml file
<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml-stylesheet type="text/xsl" href="melxsl.xsl"?>
<source>
<bold>Hello, world.</bold>
<red>I am </red>
<italic>fine.</italic>
</source>
xsl file:
<xsl:stylesheet version = '1.0'
xmlns:xsl='http://www.w3.org/1999/XSL/Transform'>
<xsl:template match="bold">
<p>
<b>
<xsl:value-of select="."/>
</b>
</p>
</xsl:template>
<xsl:template match="red">
<p style="color:red">
<xsl:value-of select="."/>
</p>
</xsl:template>
<xsl:template match="italic">
<p>
<i>
<xsl:value-of select="."/>
</i>
</p>
</xsl:template>

</xsl:stylesheet>
 
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
add this :
<xsl:template match="source">
<xsl:apply-templates/></xsl:template>
Christophe
 
Ranch Hand
Posts: 1209
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Christophe Grosjean:
add this :
<xsl:template match="source">
<xsl:apply-templates/></xsl:template>
Christophe


am not so sure if we need this. The processor will process the element when it finds a match.
IMHO,
everything looks fine with the stylesheet.
it s'd have worked. Which version of IE are you using? (i assume that you tried viewing this on
the browser because i see the stylesheet PI in your XML file.)
I use saxon command line to test my stylesheets.
Probably you might want try that or XALAN command line.
java org.apache.xalan.xslt.Process -IN <xml-file> -XSl <xsl-file>
 
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
It works with Xalan, but not with IE 5.0
 
Christophe Grosjean
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well, IE5.0 and 5.5 are not W3C standarts compliant. IE6.0 should be.
Only a subset of XSLT is supported in IE5.x. And default rules are not completely implemented. So do not rely on them.
Here is a version of your stylesheet that's working with IE5.x :
<?xml version="1.0" encoding="UTF-8" ?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/TR/WD-xsl">
<xsl:template match="/">
<HTML><BODY>
<xsl:apply-templates/>
</BODY></HTML></xsl:template>
<xsl:template match="source">
<xsl:apply-templates/></xsl:template>
<xsl:template match="bold">
<p>
<b>
<xsl:value-of select="."/>
</b>
</p>
</xsl:template>
<xsl:template match="red">
<p style="color:red">
<xsl:value-of select="."/>
</p>
</xsl:template>
<xsl:template match="italic">
<p>
<i>
<xsl:value-of select="."/>
</i>
</p>
</xsl:template>

</xsl:stylesheet>
 
Karthik Guru
Ranch Hand
Posts: 1209
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


It works with Xalan, but not with IE 5.0


Just out of curiousity..esp to all those who use XSLT heavily in projects.
How many of how you actually rely on a browser to apply the stylesheet?
Should be some real light-weight system which cannot even afford a transformer in between the presentaion layer and business logic?
 
clyde mel
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanx to all of u for your response.I'll need lot of your help coz very new to xml.I know u'll help me out.Started to learn and inteend to clear the certification.Does professional xml 2'nd Edition cover most of the certification topics.
 
Lasagna is spaghetti flvored cake. Just like this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic