You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by bu...@apache.org on 2004/07/18 01:31:23 UTC
DO NOT REPLY [Bug 27827] -
Nested Extension Elements fails with NPE
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=27827>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND
INSERTED IN THE BUG DATABASE.
http://issues.apache.org/bugzilla/show_bug.cgi?id=27827
Nested Extension Elements fails with NPE
------- Additional Comments From johnglinux@eyecatching.com 2004-07-17 23:31 -------
Some more information.
I got the example code for my project from the Redirect extension.
Where redirect uses
TransformerImpl transf = context.getTransformer();
transf.executeChildTemplates(elem,
context.getContextNode(),
context.getMode(), formatter);
With little documentation I came up with
TransformerImpl transf = context.getTransformer();
transf.executeChildTemplates(elem,
context.getContextNode(),
context.getMode(), trans.getContentHandler());
as a way for Extension Elements to process child Elements,
but it seems that getContentHandler() always returns null
which causes the problem when flushPending is called.
It also seems that the following code works
TransformerImpl transf = context.getTransformer();
transf.executeChildTemplates(elem,
context.getContextNode(),
context.getMode(), tranf.getResultTreeHandler());
There seems to be some interface confusion there, and could use better java
docs. getResultTreeHandler should be depericated in favor of
getSerializationHanldler since the older version of Xalan that is jammed into
the JDK has a different return signature which if you are not aware can cause
hours of debug time.
I am not sure what method should be called to pass the SerializationHandler down
into Child Templates but I think it still needs a second eyes because when the
Child Templates are executed TransformentImpl creates a new ToXMLSAXHandler
passing in the SerializationHandler from the executeChildTemplates call. Later
when flushPending is called, prior to executing an Extension Element, since the
ToXMLSAXHandler is new but the underlying SerializationHandler was previously
used, you can end up with extra calls to StartDocument. Now it does not seem to
have any ill effects but it seems wrong.
Thanks
John G
---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-dev-help@xml.apache.org