Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Problems with overridden templates in Xalan 2

44 views
Skip to first unread message

Andrew Storoshenko

unread,
May 11, 2001, 7:23:22 AM5/11/01
to
Hi!

We use Xalan 2 and have templates with the same name in two xsl-files.

In the first file this template is defined, and It's overridden, if
necessary, in the second file.

Since that, we've got problem that previously we had not (when we use Xalan
1).

It seems that Xalan 2.01 doesn't allow overriding templates. Is that true?

Here goes short example:

main.xsl:

... some preceding code

<xsl:template name="draw-menu">

<!-- statndart code-->

</xsl:template>

... other code

--------------------------------------------------------

dependent.xsl

<xsl:include href="../main.xsl"/>

.....

then trying to override template

<xsl:template name="draw-menu">

<!-- othrer code-->

</xsl:template>

this code causes the following exceptions:

....

javax.xml.transform.TransformerConfigurationException: TRaX Transform
Throwable
at
org.apache.xalan.processor.TransformerFactoryImpl.newTransformer(Tran
sformerFactoryImpl.java:684)
---------
javax.xml.transform.TransformerConfigurationException: TRaX Transform
Throwable
at
org.apache.xalan.processor.TransformerFactoryImpl.newTemplates(Transf
ormerFactoryImpl.java:856)
at
org.apache.xalan.processor.TransformerFactoryImpl.newTransformer(Tran
sformerFactoryImpl.java:669)
---------
javax.xml.transform.TransformerException: TRaX Transform Throwable
at
org.apache.xalan.processor.TransformerFactoryImpl.newTemplates(Transf
ormerFactoryImpl.java:852)
at
org.apache.xalan.processor.TransformerFactoryImpl.newTransformer(Tran
sformerFactoryImpl.java:669)

---------
java.lang.RuntimeException: ElemTemplateElement error: Found more than one
templ
ate named: draw-menu
at org.apache.crimson.parser.Parser2.parseInternal(Parser2.java:523)
at org.apache.crimson.parser.Parser2.parse(Parser2.java:304)
at
org.apache.crimson.parser.XMLReaderImpl.parse(XMLReaderImpl.java:433)

Any help will be greatly appreciated.

0 new messages