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)