cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Stephan Coboos" <cromo...@gmx.net>
Subject [HELP!] HSSFSerializer and XSLTransformer doesn't work together (2nd)
Date Sat, 21 Aug 2004 15:00:09 GMT
Hello,

I have a problem using XSLTTransformer and HSSFSerializer together. If I do
so, I got a NullPointerException. Vladim talked to me that I have to look
into the xalan sources and to get the original exception but I can't compile
xalan (TransformerImpl) (The source version doesn't macht with the compiled
one?).

NOTE: Using the XSLTTransformer together with XMLSerializer works well but
not with HSSFSerializer.

Can somebody help me please to solve this problem because my company want's
to using Cocoon but only if this basic feature does work in the next days.
It would be great if we are able to use Cocoon in our server park.

This is the file I want to transform:

<?xml version="1.0" encoding="ISO-8859-1"?>
<search-result>
   <!-- The result of the search goes here... -->
   <content>
      <rowset>
         <row>
            <foo>bar1</foo>
         </row>
         <row>
            <foo>bar2</foo>
         </row>
      </rowset>
   </content>
</search-result>

This is the stylesheet to transform the file above:

<?xml version="1.0"?>

<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                              xmlns:sql="http://apache.org/cocoon/SQL/2.0"
                              xmlns:gmr="http://www.gnome.org/gnumeric/v7">

   <xsl:template match="sql:rowset">
   <gmr:Workbook>
      <gmr:SheetNameIndex>
         <gmr:SheetName>Sheet1</gmr:SheetName>
      </gmr:SheetNameIndex>
      <gmr:Sheets>
         <gmr:Sheet>
         <gmr:Name>Sheet1</gmr:Name>
         <gmr:MaxCol>-1</gmr:MaxCol>
         <gmr:MaxRow>-1</gmr:MaxRow>
         <gmr:Cells>
         <xsl:for-each select="./sql:row">
            <xsl:variable name="rowNum" select="position()-1"/>
               <xsl:for-each select="node()">
               <xsl:variable name="colNum" select="position()-1"/>
               <gmr:Cell Row="{$rowNum}" Col="{$colNum}"
ValueType="60"><xsl:value-of select="."/></gmr:Cell>
               </xsl:for-each>
            </xsl:for-each>
         </gmr:Cells>
         </gmr:Sheet>
      </gmr:Sheets>
   </gmr:Workbook>
   </xsl:template>

</xsl:stylesheet>

This is the sitemap entry for this:

      <map:match pattern="search/*.xls">
         <map:generate type="file" src="test.xml"/>
         <map:transform type="xslt" src="stylesheets/searchResult2XLS.xsl"/>
         <map:serialize type="xls"/>
      </map:match>

And what I get is the following error:

Original Exception: java.lang.RuntimeException:
java.lang.NullPointerException
	at
org.apache.xalan.transformer.TransformerImpl.run(TransformerImpl.java:3407)
	at
org.apache.xalan.transformer.TransformerHandlerImpl.endDocument(TransformerH
andlerImpl.java:433)
	at
org.apache.cocoon.xml.AbstractXMLPipe.endDocument(AbstractXMLPipe.java:56)
	at
org.apache.cocoon.transformation.TraxTransformer.endDocument(TraxTransformer
.java:562)
	at org.apache.xerces.parsers.AbstractSAXParser.endDocument(Unknown Source)
	at org.apache.xerces.impl.XMLDocumentScannerImpl.endEntity(Unknown Source)
	at org.apache.xerces.impl.XMLEntityManager.endEntity(Unknown Source)
	at org.apache.xerces.impl.XMLEntityScanner.load(Unknown Source)
	at org.apache.xerces.impl.XMLEntityScanner.skipSpaces(Unknown Source)
	at
org.apache.xerces.impl.XMLDocumentScannerImpl$TrailingMiscDispatcher.dispatc
h(Unknown Source)
	at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown
Source)
	at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
	at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
	at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
	at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
	at org.apache.excalibur.xml.impl.JaxpParser.parse(JaxpParser.java:296)
.....

Thank you so much!

Regards
Stephan





Mime
View raw message