• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

ouput not displayed

 
clyde mel
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why is the output not getting displayed.The output should be Joe Smith.
Can anyone please explain the template match in details.I am using ie6 as the testing browser.I also have jaxp and IBM'S XML4J.How do i use
to test these xsl stylesheets.
xml file :
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="testxsl.xsl"?>
<source>
<employee>
<firstName>Joe</firstName>
<surname>Smith</surname>
</employee>
</source>
-------------------------------------------------------------
xsl file :
<?xml version='1.0' encoding="ISO-8859-1"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl">
<xsl:template match="employee">
<b>
<xsl:value-of select="."/>
</b>
</xsl:template>
<xsl:template match="surname">
<i>
<xsl:value-of select="."/>
</i>
</xsl:template>

</xsl:stylesheet>
 
Karthik Guru
Ranch Hand
Posts: 1209
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please use processors like saxon OR Xalan to learn XSLT and for testing your stylesheets.
Saxon has a command line version too.
you just need to do
saxon <xml-file> <xsl-file>
and it would work.
BTW Saxon is considered to be the best when it comes to adopting the latest XSL spec.
You can use xalanj from
xml.apache.org
Avoid IE for rendering/ learning and it will save you precious time!
 
Dan Drillich
Ranch Hand
Posts: 1183
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Clyde,
The only template that worked for me in IE 5.5 is -
<xsl:template match="employee">
<b>
employee
</b>
</xsl:template>
'xml in a nutshell' says (page 108) - "IE5 and IE5.5 support their own custom version of XSLT, based on a very early working draft of the XSLT specification. They do _not_ support XSLT 1.0. ... Despite superficial similarities, these two languages are not compatible."
Cheers,
Dan
 
Vidya Nayak
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Clyde,
try this in your xsl file..
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
Vidya
 
Dan Drillich
Ranch Hand
Posts: 1183
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
“A stylesheet written for IE5 uses the http://www.w3.org/TR/WD-xsl namespace, whereas a stylesheet designed for standard-compliant XSLT processors uses the http://www.w3.org/1999/XSL/Transform namespace.” (‘xml in a nutshell’ page #108).
Cheers,
Dan
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic