<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:arial, helvetica, sans-serif;font-size:10pt"><DIV><FONT size=2>
<P>Hi All,</P>
<P>I am getting the following exception when trying to do simple transformation (newbie in JDOM XSLT) using either XSLTransformer/TrAX in JDOM:</P>
<P> </P>
<P><STRONG>javax.xml.transform.TransformerConfigurationException: java.io.EOFException: no more input</STRONG></P>
<P>at com.icl.saxon.PreparedStyleSheet.prepare(PreparedStyleSheet.java:121)</P>
<P>at com.icl.saxon.TransformerFactoryImpl.newTemplates(TransformerFactoryImpl.java:120)</P>
<P>at com.icl.saxon.TransformerFactoryImpl.newTransformer(TransformerFactoryImpl.java:72)</P>
<P>at standaloneClientRemoteInvestmentBean.JDOMTrAXPojoInvestmentBean.retrieveAreaZipcode(JDOMTrAXPojoInvestmentBean.java:68)</P>
<P>at standaloneClientRemoteInvestmentBean.JDOMTrAXPojoInvestmentBean.main(JDOMTrAXPojoInvestmentBean.java:37)</P>
<P>Caused by: java.io.EOFException: no more input</P>
<P>at com.icl.saxon.aelfred.XmlParser.popInput(XmlParser.java:4083)</P>
<P>at com.icl.saxon.aelfred.XmlParser.pushURL(XmlParser.java:3620)</P>
<P>at com.icl.saxon.aelfred.XmlParser.doParse(XmlParser.java:159)</P>
<P>at com.icl.saxon.aelfred.SAXDriver.parse(SAXDriver.java:320)</P>
<P>at com.icl.saxon.om.Builder.build(Builder.java:265)</P>
<P>at com.icl.saxon.PreparedStyleSheet.prepare(PreparedStyleSheet.java:111)</P>
<P>... 4 more</P>
<P> </P>
<P>Below is the stateStyleSheet:</P>
<P><?xml version="1.0" encoding="ISO-8859-1"?></P>
<P><xsl:stylesheet version="1.0"</P>
<P>xmlns:xsl="http://www.w3.org/1999/XSL/Transform"></P>
<P></P>
<P><xsl:template match="/"></P>
<P><html></P>
<P><body></P>
<P><h2>Transformed State Detail</h2></P>
<P><table border="1"></P>
<P><tr bgcolor="lightblue"></P>
<P><th align="left">Area Link</th></P>
<P><th align="left">Area Name</th></P>
<P></tr></P>
<P><xsl:for-each select="<STRONG>/ns:html/ns:body/ns:div[@id='content']/ns:table[@class='sresults']/ns:tr/ns:td/ns:a</STRONG>"></P>
<P><tr></P>
<P><td><xsl:value-of select="@href"/></td></P>
<P><td><xsl:value-of select="@title"/></td></P>
<P></tr></P>
<P></xsl:for-each></P>
<P></table></P>
<P></body></P>
<P></html></P>
<P></xsl:template></P>
<P></xsl:stylesheet></P>
<P> </P>
<P>The Java program that calls this stateStyleSheet is as follows:</P>
<P> SAXBuilder statesaxBuilder = new SAXBuilder("org.ccil.cowan.tagsoup.Parser", false);</P>
<P> org.jdom.Document stateDocument = statesaxBuilder.build("state.xml");</P>
<P> TransformerFactory factory = TransformerFactory.newInstance();</P>
<P> Transformer transformer = factory.newTransformer(new StreamSource("stateStyleSheet.xsl"));</P>
<P> JDOMSource source = new JDOMSource(stateDocument);</P>
<P> JDOMResult result = new JDOMResult();</P>
<P> transformer.transform(source, result);</P>
<P> Document tranformedDocument = result.getDocument();</P>
<P> ......</P>
<P> </P>
<P>Could this exception have been caused by incorrectly formatted stateStyleSheet? The search path "/ns:html/ns:body/ns:div[@id='content']/ns:table[@class='sresults']/ns:tr/ns:td/ns:a" has successfully worked in XPath such as the following lines:</P>
<P> </P>
<P> XPath statePath = XPath.newInstance("<STRONG>/ns:html/ns:body/ns:div[@id='content']/ns:table [@class='sresults']/ns:tr/ns:td/ns:a</STRONG>");</P>
<P> statePath.addNamespace("ns", <A href="http://www.w3.org/1999/xhtml">http://www.w3.org/1999/xhtml</A>);</P>
<P> </P>
<P>Whether including namespace ("ns") or not doesn't make any difference.</P>
<P>I am running JDK1.6, Netbeans 6.1, JDOM 1.1, Saxon 6.5, TagSoup 1.2 on Windows XP platform.</P>
<P>Your assistance would be much appreciated.</P>
<P>Many thanks,</P>
<P>Jack</P>
<P></P></FONT></DIV></div><br>
<hr size=1>
Stay connected to the people that matter most with a smarter inbox. <a href="http://au.rd.yahoo.com/galaxy/mail/tagline2/*http://au.docs.yahoo.com/mail/smarterinbox" target=_blank>Take a look</a>.</body></html>