TransformerException when importing stylesheet

Here should go questions about transforming XML with XSLT and FOP.
jayis
Posts: 1
Joined: Sun Apr 10, 2005 10:40 am

TransformerException when importing stylesheet

Post by jayis »

Oxygen no longer likes it when I import an XSLT Standard Library stylesheet that I have been using to format date elements. It worked once, but now I get the following error whenever trying to import the stylesheet:

javax.xml.transform.TransformerException: ElemTemplateElement error: str:to-upper

I am using the date-time.xsl template from this URL:

http://xsltsl.sourceforge.net/

importing it into this stylesheet:

http://vega.it.rit.edu/~jhb4598/772/importest.xsl

to transform this xml document:

http://vega.it.rit.edu/~jhb4598/772/importest.xml

As you can see by loading the XML doc in a browser, the transformation is performed correctly, but Oxygen chokes on it. Does anyone know why? I am considering purchasing Oxygen, but I am skeptical now that this problem seems to be something with Oxygen.

Thank you kindly.

Jay
sorin_ristache
Posts: 4141
Joined: Fri Mar 28, 2003 2:12 pm

Post by sorin_ristache »

Hello Jay,

You get that error because the stylesheet date-time.xsl is not valid without importing string.xsl. This is needed because date-time.xsl uses at line 1073 the template 'to-upper' defined in string.xsl:

Code: Select all


  <xsl:call-template name='str:to-upper'>
<xsl:with-param name='text' select='$month'/>
</xsl:call-template>
You can see this as validation error by trying to validate date-time.xsl in <oXygen/>.

You have two options:
- import also string.xsl in importest.xsl just as you do for date-time.xsl;
- instead of date-time.xsl import stdlib.xsl - the main stylesheet of the library which imports all the other library components:

Code: Select all


  <xsl:import href="stdlib.xsl"/>
I recommend the second approach as you may run into other such dependency issues later.

Best regards,
Sorin
Post Reply