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

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
 
Let me tell you a story about a man named Jed. He made this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic