Classe of parameter for java extensions 2003-01-09 - By CLAVIER Remi FTRD/RTA/LAN
This mail was posted with a bad titlle... Apologize... ------------------------------------------------------------------------ ---- Have all people in the list an happy new year... and sorry to use HTML in the mail
I've a problem using java extension in xalan. an extension java call give me 2 different objects, depending of the call in the XSL transform.
considering the java extension call public String initTables(org.apache.xalan.extensions.XSLProcessorContext context, org.w3c.dom.Element elem1) {org.w3c.dom.Element elemC=( org.w3c.dom.Element) context.getContextNode(); ... }
and the transformation given in the XSL listing above. It's work well and the object in elemC is an org.apache.xerces.dom.DefferedElementNSimpl object (as expected)
but if I change the line <xsl:apply-templates select="/doc" mode="test" /> by the line <xsl:apply-templates select="xalan:nodeset($mydoc)/doc" mode="test" /> in comment in the listing ( what I need to do) , the returned object is an org.apache.dtm.ref.DTMNodeProxy object and the rest of the function don't work.
It's a cast problem or a bug from xalan? how to cast it properly to have a Element object ?
<?xml version="1.0" encoding="ISO-8859-1"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:lxslt="http://xml.apache.org/xslt" xmlns:exc="MyExcWriter" xmlns:xalan="http://xml.apache.org/xalan" extension-element-prefixes="exc xalan" version="1.0"> <xsl:output method="xml" encoding ="ISO-8859-1" />
<lxslt:component prefix="exc" elements=" initTables" functions=" "> <lxslt:script lang="javaclass" src="MyExcWriter"/> </lxslt:component>
<xsl:template match="/doc"> <test> <xsl:variable name="mydoc"> <xsl:copy-of select="." /> </xsl:variable> <xsl:copy-of select="$mydoc" /> <!--<xsl:apply-templates select="xalan:nodeset($mydoc)/doc" mode="test" />--> <xsl:apply-templates select="/doc" mode="test" /> </test> </xsl:template>
<xsl:template match="/doc" mode="test"> <exc:initTables name="index" /> </xsl:template>
</xsl:stylesheet>
Thank's for answer... Mr Remi Clavier Expert Methodes et Outils France Telecom R&D/RTA/D2M 2, Avenue Pierre Marzin 22307 Lannion tel : +33 2 96 05 22 20 fax: +33 2 96 05 22 20 e_mail : remi.clavier@(protected)
--------------------------------------------------------------------- To unsubscribe, e-mail: xerces-j-user-unsubscribe@(protected) For additional commands, e-mail: xerces-j-user-help@(protected)
|
|