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 Andreas Hartmann <an...@apache.org> on 2003/08/27 15:23:28 UTC

NoSuchMethodError in named template

Hi Xalan users,

I'm running the following setup:
- Lenya CVS
- Cocoon 2.1 Release
- Tomcat 5.0.9
- xalan-j_20030826 as endorsed libraries

and get the following error:

java.lang.NoSuchMethodError: 
page2xhtml.getdocument(Lorg/apache/xalan/xsltc/DOM;Lorg/apache/xml/dtm/DTMAxisIterator;Lorg/apache/xml/serializer/SerializationHandler;I)V
	at page2xhtml.language$dash$link()
	at page2xhtml.topnavbar()
	at page2xhtml.applyTemplates()
	at page2xhtml.applyTemplates()
	at page2xhtml.transform()
	at 
org.apache.xalan.xsltc.runtime.AbstractTranslet.transform(AbstractTranslet.java:545)
	at 
org.apache.xalan.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:671)

The template named "getdocument" does exist.

How can I trace this error?
It does not happen with Tomcat 4.1.24 and the same Xalan version.

Thanks in advance!
Andreas



xalan:write how-to add namespace declarations

Posted by f_Parlant <f_...@laposte.net>.
hi,

I sent this question a week ago, and didn't get any answer, I try to
reformulate in this post.

I'm breaking a big file into parts and I need to insert my namespaces
declaration in the root element of the newly created files.

Unfortunately, xalan keeps stripping my declarations.


<xsl:template match="//cib:file">
   <xsl:apply-templates />
        <xalan:write
select="concat('myfile',position(),'.xml')">
<frag xmlns:cib="http://cib.homedns.org"> <!-- root element -->
   <xsl:apply-templates />
</frag>
   </xalan:write>
</xsl:template>

RESULT
<?xml version="1.0"?>
<frag> <!-- declaration has been stripped -->
my fragment
</frag>

-I've also tried with xsl:element (but xmlns:cib as an xml:attribute was not
a good idea)
-and with xsl:pi (got an error if I remember well)

How can I add namespace declaration to THIS ELEMENT only.

As this is my second post, don't hesitate  for any hint.
Thanks
François



xalan:write namespaces stripped in root element

Posted by f_Parlant <f_...@laposte.net>.
hi,

I'm desperately trying to cut a big file in small ones. I therefore need to
add the namespaces in a the root element of each created file.
Unfortunately, they are either stripped or I get an error for xmlns placed
there.

<xsl:template match="//cib:file">
   <xsl:apply-templates />
        <xalan:write
select="concat('cib3\','file-',position(),'-',$SourceURI)">
<cib:doc xmlns:cib="http://cib.wanadoo.fr/xmlns/cib"> <!-- root element -->
   <xsl:apply-templates />
</cib:doc>
   </xalan:write>
</xsl:template>

RESULT
<cib:doc>
my fragment
</cib:doc>

I've also tried with xsl:element (but xmlns:cib as an xml:attribute was not
a good idea)
I tried with simpler elements but didn't succeed.

How can I add namespace declaration to THIS ELEMENT only.

Thanks for any answer.

François