This week's book giveaway is in the Java in General forum.
We're giving away four copies of Event Streams in Action and have Alexander Dean & Valentin Crettaz on-line!
See this thread for details.
Win a copy of Event Streams in Action this week in the Java in General 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
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Knute Snortum
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Ron McLeod
  • Piet Souris
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Ganesh Patekar

ouput not displayed

 
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>
 
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!
 
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
 
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
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!