  | |  | DOOM6 Hierachy error | DOOM6 Hierachy error 2003-01-08 - By CLAVIER Remi FTRD/RTA/LAN
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 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 bolded line by the line 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 ? 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 : <mailto:remi.clavier@(protected)> remi.clavier@(protected)
<?xml version="1.0" encoding="ISO-8859-1"?> <xsl:stylesheet xmlns:xsl=" <http://www.w3.org/1999/XSL/Transform> http://www.w3.org/1999/XSL/Transform" xmlns:lxslt=" <http://xml.apache.org/xslt> http://xml.apache.org/xslt" xmlns:exc="MyExcWriter" xmlns:xalan=" <http://xml.apache.org/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>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML><HEAD> <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii"> <TITLE></TITLE>
<META content="MSHTML 6.00.2800.1106" name=GENERATOR></HEAD> <BODY><FONT face=Arial color=#0000ff size=2></FONT> <DIV><FONT face=Arial color=#0000ff size=2> <DIV><FONT color=#0000ff> <DIV><FONT face=Arial size=2>Have all people in the list an happy new year... and sorry to use HTML in the mail</FONT></DIV> <DIV><FONT face=Arial size=2></FONT> </DIV> <DIV><FONT face=Arial size=2>I've a problem using java extension in xalan.</FONT></DIV> <DIV><FONT face=Arial size=2>an extension java call give me 2 different objects , depending of the call in the XSL transform.</FONT></DIV> <DIV><FONT face=Arial size=2></FONT> </DIV> <DIV><FONT face=Arial size=2>considering the java extension call </FONT></DIV> <DIV><FONT face=Arial color=#800080 size=2><STRONG>public String initTables(org.apache.xalan.extensions.XSLProcessorContext context,<BR> org.w3c.dom.Element elem1)</STRONG></FONT></DIV> <DIV><FONT face=Arial color=#800080 size=2><STRONG>{org.w3c.dom.Element elemC=( org.w3c.dom.Element) context.getContextNode();</STRONG></FONT></DIV> <DIV><FONT face=Arial color=#800080 size=2><STRONG>...</STRONG></FONT></DIV> <DIV><FONT face=Arial color=#800080 size=2><STRONG>}</STRONG></FONT></DIV> <DIV><FONT face=Arial size=2></FONT> </DIV> <DIV><FONT face=Arial size=2>and the transformation given in the listing <SPAN class=801292709-08012003>above</SPAN>.</FONT></DIV> <DIV><FONT face=Arial size=2>It's work well and the object in elemC is an </FONT></DIV> <DIV><FONT face=Arial size=2>org.apache.xerces.dom.DefferedElementNSimpl object </FONT></DIV> <DIV><FONT face=Arial size=2>(as expected)</FONT></DIV> <DIV><FONT face=Arial size=2></FONT> </DIV> <DIV><FONT face=Arial size=2>but if I change the bolded line by the line in comment in the listing ( what I need to do) , the returned object is an</FONT></DIV> <DIV><FONT face=Arial size=2>org.apache.dtm.ref.DTMNodeProxy object </FONT></DIV> <DIV><FONT face=Arial size=2>and the rest of the function don't work.</FONT></DIV> <DIV><FONT face=Arial size=2></FONT> </DIV> <DIV><FONT face=Arial size=2>It's a cast problem or a bug from xalan?</FONT></DIV> <DIV><FONT face=Arial size=2>how to cast it properly to have a <SPAN class=801292709-08012003>Element</SPAN> object ?</FONT></DIV> <DIV><FONT face=Arial size=2></FONT> </DIV> <DIV><FONT face=Arial size=2>Thank's for answer...</FONT></DIV> <DIV> <P><FONT face=Arial color=#800000 size=2><EM><STRONG>Mr Rémi Clavier<BR></STRONG></EM></FONT><EM><FONT face=Arial size=2>Expert Mé ;thodes et Outils<BR></FONT></EM><EM><FONT face=Arial color=#000080 size=2><STRONG>France Telecom R&D/RTA/D2M<BR></STRONG></FONT></EM><FONT face=Arial><FONT size=2><STRONG><FONT color=#000080><EM>2, Avenue Pierre Marzin<BR>22307 Lannion<BR></EM></FONT>tel : </STRONG>+33 2 96 05 22 20<BR><STRONG>fax: </STRONG>+33 2 96 05 22 20<BR><STRONG>e_mail : </STRONG></FONT></FONT><A href="mailto:remi.clavier@(protected)"><FONT face=Arial size=2>remi.clavier@(protected)</FONT></A><BR><BR></P></DIV> <DIV><FONT face=Arial size=2></FONT> </DIV> <DIV><FONT face=Arial color=#000080 size=2><STRONG><?xml version="1.0" encoding="ISO-8859-1"?><BR><xsl:stylesheet xmlns:xsl="</STRONG></FONT><A href="http://www.w3.org/1999/XSL/Transform"><FONT face=Arial color=#000080 size=2><STRONG>http://www.w3.org/1999/XSL/Transform</STRONG></FONT></A><FONT face=Arial color=#000080 size=2><STRONG>"<BR>   ; xmlns:lxslt="</STRONG></FONT><A href="http://xml.apache.org/xslt"><FONT face=Arial color=#000080 size=2><STRONG>http://xml.apache.org/xslt</STRONG></FONT></A><FONT face=Arial color=#000080 size=2><STRONG>"<BR>   ; xmlns:exc="MyExcWriter"<BR> xmlns:xalan="</STRONG></FONT><A href="http://xml.apache.org/xalan"><FONT face=Arial color=#000080 size=2><STRONG>http://xml.apache.org/xalan</STRONG></FONT></A><FONT face=Arial color=#000080 size=2><STRONG>"<BR>   ; extension-element-prefixes="exc xalan"<BR> version="1.0"><BR><xsl:output method="xml" encoding ="ISO-8859-1" /></STRONG></FONT></DIV> <DIV><FONT face=Arial color=#000080 size=2><STRONG></STRONG></FONT> </DIV> <DIV><FONT face=Arial color=#000080 size=2><STRONG> <lxslt:component prefix="exc"<BR> elements=" initTables"<BR> functions=" "></STRONG></FONT></DIV> <DIV><FONT face=Arial color=#000080 size=2><STRONG> <lxslt:script lang="javaclass" src="MyExcWriter"/><BR> </lxslt:component></STRONG></FONT></DIV> <DIV><FONT face=Arial color=#000080 size=2><STRONG></STRONG></FONT> </DIV> <DIV><FONT face=Arial color=#000080 size=2><STRONG><xsl:template match="/doc"><BR><test><BR><xsl:variable name="mydoc"><BR><xsl:copy-of select="." /><BR></xsl:variable></STRONG></FONT></DIV> <DIV><FONT face=Arial color=#000080 size=2><STRONG><xsl:copy-of select="$mydoc" /><BR><!--<xsl:apply-templates select="xalan:nodeset($mydoc)/doc" mode="test" />--><BR></STRONG></FONT><FONT face=Arial><FONT size=2><FONT color=#000080><STRONG><xsl:apply-templates select="/doc" mode="test" /><BR></test><BR></xsl:template></STRONG></FONT></FONT></FONT>< /DIV> <DIV><FONT face=Arial size=2></FONT><BR><FONT face=Arial color=#000080 size=2><STRONG><xsl:template match="/doc" mode="test"><BR><exc:initTables name="index" /></STRONG></FONT></DIV> <DIV><FONT face=Arial color=#000080 size=2><STRONG></xsl:template></STRONG></FONT></DIV> <DIV><FONT face=Arial color=#000080 size=2><STRONG></STRONG></FONT> </DIV> <DIV><FONT face=Arial color=#000080 size=2><STRONG></xsl:stylesheet></STRONG></FONT></DIV></FONT></DIV></FONT ></DIV></BODY></HTML>
|
|
 |