Subjects
Home
Xalan extension functions
Fomatting question serializing DOM with pretty print
xalan with pull parser
Cannot find the declaration
Apache Xalan drop support to run on JRE 1 1 x
Why does Doctype change processing of a document
Node set to XML string via Java extensions in Xalan J: possible?
Templates/Transformers + thread safety???
Problem evaluating xpath with muliple prefix with different namespace
remove an arbitrary attribute from xsl output
Xalan3 XSLT 2 0 XPath 2 0 support?
Problem using compiled translets with Xalan !!
Xalan and jstl 1 1 problem with transform tag
NullPointer in DOM2DTM getLocalName
URIResolvers base parameter with xsltc and cascaded imports
Performance problem for Xalan J on intel dual core
Standard libraries in JAXP?
Serializing a DOM tree to XML file, customize entities replacement
Library Conflict Involving BCEL Library
A question on how users are using <xsl:message >
Kevin Cormier as a new Apache Xalan J committer
Struggling to iterate over tokenized string
Xalan count() trouble
Problem with recursive xpath
Error when switching to java 1 5
document( ' ')
Problem with Xalan2 7 0 transformation
cr/lf options
entity encoded XML
can xalan transform 2 xml using one xslt?
Xalan J JIRA defect review Monday October 16, 2006 from 2:00 to 3:30 pm ED
xsl transform with cdata section elements
xslt parameters not expanded
Weird behavior of XPath evaluate()
How to avoid <xsl:message > instruction prints stylesheet file informations ?
Cannot find SimpleTransform subdirectory after installing Xalan J
recover from document not found exceptions
jdk1 5 and Xalan jar differences?
Performance Issue
Error/Bug adding floating point numbers
XPathAPI: eval exp using nodes with default namespace
modifying xalan to output invalid XML
NullPointerException
mege two separate xml nodes into one
Is this a XALAN document identification bug?
is StylesheetRoot really java io Serializable ?
transform() fails for DOMSource but succeeds for StreamSource
Thoughts on Transformer parameter passing
HELP, Xalan and jstl 1 1 problem with transformer
Problem with XPath namespace axis?
string utils:replace deleting search string if replacement string is an HTML
help with enumeration values pls
xalan 2 5 1 vs 2 7 performance question
How to insert/update in XML document
HTML Serialization and Handling of Ampersands in HREF Attributes
XHTML link tag stripping
SystemId Unknown; Line #24; Column #49; java lang NullPointerException
xpath text() help
Apostrophe problem with xalan 2 7 0
How to set variables in XML document?
Links
Home
Oracle database error code ...
 
Search:  
Power your search with and, or, +, -, or "some phrase" operators.
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>&nbsp;</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>&nbsp;</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>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
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>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>and the transformation given in the
listing&nbsp;<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>&nbsp;</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&nbsp; 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>&nbsp;</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&nbsp;<SPAN
class=801292709-08012003>Element</SPAN> object ?</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</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&eacute;mi
Clavier<BR></STRONG></EM></FONT><EM><FONT face=Arial size=2>Expert M&eacute
;thodes et
Outils<BR></FONT></EM><EM><FONT face=Arial color=#000080 size=2><STRONG>France
Telecom R&amp;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>&nbsp;</DIV>
<DIV><FONT face=Arial color=#000080 size=2><STRONG>&lt;?xml version="1.0"
encoding="ISO-8859-1"?&gt;<BR>&lt;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>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
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>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
xmlns:exc="MyExcWriter"<BR>&nbsp;&nbsp;&nbsp;&nbsp;
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>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
extension-element-prefixes="exc
xalan"<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;
version="1.0"&gt;<BR>&lt;xsl:output method="xml" encoding ="ISO-8859-1"
/&gt;</STRONG></FONT></DIV>
<DIV><FONT face=Arial color=#000080 size=2><STRONG></STRONG></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial color=#000080 size=2><STRONG>&nbsp; &lt;lxslt:component
prefix="exc"<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
elements="&nbsp;
initTables"<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
functions="&nbsp;&nbsp;&nbsp; "&gt;</STRONG></FONT></DIV>
<DIV><FONT face=Arial color=#000080 size=2><STRONG>&nbsp;&nbsp;&nbsp;
&lt;lxslt:script lang="javaclass" src="MyExcWriter"/&gt;<BR>&nbsp;
&lt;/lxslt:component&gt;</STRONG></FONT></DIV>
<DIV><FONT face=Arial color=#000080 size=2><STRONG></STRONG></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial color=#000080 size=2><STRONG>&lt;xsl:template
match="/doc"&gt;<BR>&lt;test&gt;<BR>&lt;xsl:variable
name="mydoc"&gt;<BR>&lt;xsl:copy-of select="."
/&gt;<BR>&lt;/xsl:variable&gt;</STRONG></FONT></DIV>
<DIV><FONT face=Arial color=#000080 size=2><STRONG>&lt;xsl:copy-of
select="$mydoc" /&gt;<BR>&lt;!--&lt;xsl:apply-templates
select="xalan:nodeset($mydoc)/doc" mode="test"
/&gt;--&gt;<BR></STRONG></FONT><FONT face=Arial><FONT size=2><FONT
color=#000080><STRONG>&lt;xsl:apply-templates select="/doc" mode="test"
/&gt;<BR>&lt;/test&gt;<BR>&lt;/xsl:template&gt;</STRONG></FONT></FONT></FONT><
/DIV>
<DIV><FONT face=Arial size=2></FONT><BR><FONT face=Arial color=#000080
size=2><STRONG>&lt;xsl:template match="/doc"
mode="test"&gt;<BR>&lt;exc:initTables name="index" /&gt;</STRONG></FONT></DIV>
<DIV><FONT face=Arial color=#000080
size=2><STRONG>&lt;/xsl:template&gt;</STRONG></FONT></DIV>
<DIV><FONT face=Arial color=#000080 size=2><STRONG></STRONG></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial color=#000080
size=2><STRONG>&lt;/xsl:stylesheet&gt;</STRONG></FONT></DIV></FONT></DIV></FONT
></DIV></BODY></HTML>