Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: [xml-dev] JDOM XSLT TransformerConfigurationException

From: Robert Koberg <rob@------.--->
To: Jack Bush <netbeansfan@-----.---.-->
Date: 1/2/2009 2:12:00 PM
Hi,

The ns namespace prefix isn't defined anywhere.

best


On Jan 2, 2009, at 8:53 AM, Jack Bush wrote:

> Hi All,
> I am getting the following exception when trying to do simple  
> transformation (newbie in JDOM XSLT) using either XSLTransformer/ 
> TrAX in JDOM:
>
>
> javax.xml.transform.TransformerConfigurationException:  
> java.io.EOFException: no more input
>
> at com.icl.saxon.PreparedStyleSheet.prepare(PreparedStyleSheet.java: 
> 121)
>
> at  
> com 
> .icl 
> .saxon 
> .TransformerFactoryImpl.newTemplates(TransformerFactoryImpl.java:120)
>
> at  
> com 
> .icl 
> .saxon 
> .TransformerFactoryImpl.newTransformer(TransformerFactoryImpl.java:72)
>
> at  
> standaloneClientRemoteInvestmentBean 
> .JDOMTrAXPojoInvestmentBean 
> .retrieveAreaZipcode(JDOMTrAXPojoInvestmentBean.java:68)
>
> at  
> standaloneClientRemoteInvestmentBean 
> .JDOMTrAXPojoInvestmentBean.main(JDOMTrAXPojoInvestmentBean.java:37)
>
> Caused by: java.io..EOFException: no more input
>
> at com.icl.saxon.aelfred.XmlParser.popInput(XmlParser.java:4083)
>
> at com.icl.saxon.aelfred.XmlParser.pushURL(XmlParser.java:3620)
>
> at com.icl.saxon.aelfred.XmlParser.doParse(XmlParser.java:159)
>
> at com.icl.saxon.aelfred.SAXDriver.parse(SAXDriver.java:320)
>
> at com.icl.saxon.om.Builder.build(Builder.java:265)
>
> at com.icl.saxon.PreparedStyleSheet.prepare(PreparedStyleSheet..java: 
> 111)
>
> ... 4 more
>
>
> Below is the stateStyleSheet:
>
> <?xml version="1.0" encoding="ISO-8859-1"?>
>
> <xsl:stylesheet version="1.0"
>
> xmlns:xsl="http://www..w3.org/1999/XSL/Transform">
>
>
> <xsl:template match="/">
>
> <html>
>
> <body>
>
> <h2>Transformed State Detail</h2>
>
> <table border="1">
>
> <tr bgcolor="lightblue">
>
> <th align="left">Area Link</th>
>
> <th align="left">Area Name</th>
>
> </tr>
>
> <xsl:for-each select="/ns:html/ns:body/ns:div[@id='content']/ 
> ns:table[@class='sresults']/ns:tr/ns:td/ns:a">
>
> <tr>
>
> <td><xsl:value-of select="@href"/></td>
>
> <td><xsl:value-of select="@title"/></td>
>
> </tr>
>
> </xsl:for-each>
>
> </table>
>
> </body>
>
> </html>
>
> </xsl:template>
>
> </xsl:stylesheet>
>
>
> The Java program that calls this stateStyleSheet is as follows:
>
>     SAXBuilder statesaxBuilder = new  
> SAXBuilder("org.ccil.cowan.tagsoup.Parser", false);
>
>     org.jdom.Document stateDocument =  
> statesaxBuilder.build("state.xml");
>
>     TransformerFactory factory = TransformerFactory.newInstance();
>
>     Transformer transformer = factory.newTransformer(new  
> StreamSource("stateStyleSheet.xsl"));
>
>     JDOMSource source = new JDOMSource(stateDocument);
>
>     JDOMResult result = new JDOMResult();
>
>     transformer.transform(source, result);
>
>     Document tranformedDocument = result.getDocument();
>
>     ......
>
>
> 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:
>
>
>     XPath statePath = XPath.newInstance("/ns:html/ns:body/ 
> ns:div[@id='content']/ns:table [@class='sresults']/ns:tr/ns:td/ns:a");
>
>     statePath.addNamespace("ns", http://www.w3.org/1999/xhtml);
>
>
> Whether including namespace ("ns") or not doesn't make any difference.
>
> I am running JDK1.6, Netbeans 6.1, JDOM 1.1, Saxon 6.5, TagSoup 1.2  
> on Windows XP platform.
>
> Your assistance would be much appreciated.
>
> Many thanks,
>
> Jack
>
>
>
> Stay connected to the people that matter most with a smarter inbox.  
> Take a look.
>
> Stay connected to the people that matter most with a smarter inbox.  
> Take a look.


_______________________________________________________________________

XML-DEV is a publicly archived, unmoderated list hosted by OASIS
to support XML implementation and development. To minimize
spam in the archives, you must subscribe before posting.

[Un]Subscribe/change address: http://www.oasis-open.org/mlmanage/
Or unsubscribe: xml-dev-unsubscribe@l...
subscribe: xml-dev-subscribe@l...
List archive: http://lists.xml.org/archives/xml-dev/
List Guidelines: http://www.oasis-open.org/maillists/guidelines.php



transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent