You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-users@xalan.apache.org by Klaus Ole Kristiansen <kl...@Q8.DK> on 2003/06/03 15:40:58 UTC

javax.xml.transform.TransformerException with null message

I am working on a servlet generating pdf using fop-0.20.5rc2.
It uses a Templates object "stylesheet", like this:

    //Setup XSLT
    Transformer transformer = styleSheet.newTransformer();

    Iterator entries = parameters.entrySet().iterator();
    while (entries.hasNext()) {
      Map.Entry entry = (Map.Entry) entries.next();
      transformer.setParameter((String) entry.getKey(), entry.getValue());
    }

    //Resulting SAX events (the generated FO) must be piped through to FOP
    Result res = new SAXResult(driver.getContentHandler());

    //Start XSLT transformation and FOP processing
    transformer.transform(xml, res);

When I run this from the IDE on my PC, it works. Under Tomcat on a unix
box, it works for some style sheets, but for some which work on the
PC I get an error, which I find very confusing.  See attached file.

First FOP reports the pdf rendered with no problems, then Xalan throws
an exception.

Do any of you know what might be causing this?

The unix box uses j2sdk1_3_1_01 and xalan-2.0.0, the pc uses j2sdk1_3_1_07

Here is a short stylesheet that causes the error:

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

  <xsl:param name="studerende"/>
  <xsl:param name="skole"/>

  <xsl:template match="/">
    <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
      <fo:layout-master-set>
        <fo:simple-page-master margin-right="2cm" margin-left="2cm"
margin-bottom="1cm" margin-top="1cm" page-width="21cm" page-height="29.7cm"
master-name="simple">
          <fo:region-body margin-top="0.5cm"/>
          <fo:region-before extent="0.5cm"/>
          <fo:region-after extent="0.5cm"/>
        </fo:simple-page-master>
      </fo:layout-master-set>

      <fo:page-sequence language="da" hyphenate="false"
master-reference="simple">
        <fo:flow flow-name="xsl-region-body">
          <fo:block text-align="left" font-family="sans-serif"
font-size="9pt">
            <fo:block font-size="11pt" break-after="page">

              <fo:block space-before.optimum="2pt"
space-after.optimum="2pt">
                <fo:table table-layout="fixed">
                  <fo:table-column column-width="53mm"/>
                  <fo:table-column column-width="53mm"/>
                  <fo:table-column column-width="53mm"/>
                  <fo:table-body>
                    <fo:table-row>
                      <fo:table-cell border-color="black"
border-width="0.2mm" border-style="solid" keep-together.within-page="always"
padding="1mm">
                        <fo:block>
                          Under uddannelse: <xsl:value-of
select="$studerende"/>
                        </fo:block>
                      </fo:table-cell>
                      <fo:table-cell border-color="black"
border-width="0.2mm" border-style="solid" keep-together.within-page="always"
padding="1mm" number-columns-spanned="2">
                        <fo:block>
                          Går på/I lære som: <xsl:value-of select="$skole"/>
                        </fo:block>
                      </fo:table-cell>
                    </fo:table-row>
                  </fo:table-body>
                </fo:table>
              </fo:block>

            </fo:block>

          </fo:block>
        </fo:flow>
      </fo:page-sequence>
    </fo:root>
  </xsl:template>
</xsl:stylesheet>

I have not been able to come up with a search string that finds anything
promising in the list archives or
on Google.

Klaus Kristiansen
Q8