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

cannot compile xsl stylesheet

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi

I am trying to apply xsl over my xml.It works fine in my home system and my frens systems.But when I run the same thing in my work system it gives me error (see below).It works strangely.One time it works fine,next time it shows up with this error.
Am using java 1.5 and xalan
my sample xml and xsl are here :

phonebook.xml

<?xml version="1.0" encoding="UTF-8"?>

<phonebook type="personal">
<entry>
<lastname>McLaughlin</lastname>
<firstname>Brett</firstname>
<address type="home">
<street>1818 Writer's Lane</street>
<city>Lorena</city>
<state>TX</state>
<zip>76655</zip>
</address>
<address type="work">
<street>4810 Apartment Row</street>
<city>Dallas</city>
<state>TX</state>
<zip>75219</zip>
</address>
</entry>

<entry>
<lastname>Greathouse</lastname>
<firstname>Gary</firstname>
<address type="home">
<street>10012 Town East Drive</street>
<city>Waco</city>
<state>TX</state>
<zip>76712</zip>
</address>
</entry>
</phonebook>

phonebook.xsl

<xsl:stylesheet version = "1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:template match="/">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US" lang="en-US">
<head profile="http://www.w3.org/2000/08/w3c-synd/#">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Phonebook</title>
</head>

<body>
<h1 align="center">Phonebook</h1>
<xsl:apply-templates select="*" />
</body>
</html>
</xsl:template>

<xsl:template match="entry">
<h3>
<xsl:value-of select="firstname" />
<xsl:text> </xsl:text>
<xsl:value-of select="lastname" />
</h3>
<ul>
<xsl:apply-templates select="address" />
</ul>
<hr width="83%" />
</xsl:template>

<xsl:template match="address">
<li><u>
<xsl:variable name="address-type"
select="@type" />
<xsl:choose>
<xsl:when test='$address-type="home"'>
Home Address
</xsl:when>
<xsl:when test='$address-type="work"'>
Work Address
</xsl:when>
<xsl:otherwise>
Misc. Address ($address-type)
</xsl:otherwise>
</xsl:choose></u><br />
<xsl:value-of select="street" /><br />
<xsl:value-of select="city" />
<xsl:text>, </xsl:text>
<xsl:value-of select="state" />
<xsl:text> </xsl:text>
<xsl:value-of select="zip" />
</li>
</xsl:template>

</xsl:stylesheet>




Error



-ERROR: 'Stream closed'
FATAL ERROR: 'Could not compile stylesheet'
The underlying XSL processor does not support the requested features.
javax.xml.transform.TransformerConfigurationException: Could not compile stylesheet
at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl.newTemplates(TransformerFactoryImpl.java:824)
at searchwebapp.search.pagedetails.PageDetailsTemplate.getXslTemplate(PageDetailsTemplate.java:43)
at searchwebapp.search.pagedetails.PageDetailsActions.getPageDetails(PageDetailsActions.java:51)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
"sriya", please check your private messages for an important administrative matter.
 
sriya komn
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sorry I got a private msg but nothing is there in that email.
 
Marshal
Posts: 28193
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have sent you another private message regarding the same administrative matter.
 
sriya komn
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks I updated as you said.
 
keep an eye out for scorpions and black widows. But the tiny ads are safe.
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic