Hello.
"toadie D" <[EMAIL PROTECTED]> wrote on 2006-04-27 01:57:04 PM:
> Thanks for the quick reply. Yes I would say it's a bit confusing
> and misleading.
> In fact if you comment out these 2 lines in the sample code, v2.7.0
> still throws an NPE, but it's just thrown
> from somewhere else.
>
> byte[] value = "<Foo/>".getBytes();
> t.setParameter("FooParam", value);
I took a look at your test case, and I think this is actually due to
a usability problem in JAXP 1.3. JAXP 1.3 says that if no ErrorListener
is set on a TransformerFactory, the default ErrorListener reports messgaes
to System.err, but does not throw exceptions. JAXP 1.3 also implies that
the processor should not throw TransformerExceptions on its own - that it
should be up to the ErrorListener to decide whether to throw an exception.
JAXP 1.4 has resolved this usability problem by changing the
specification to say that those methods that create a new Transformer or
Templates object should throw a TransformerConfigurationException if they
are unable to create a new Transformer or Templates object, even if the
ErrorListener chose not to throw an exception.
Please open a bug report against Xalan-J for this, and attach your
test case to the bug report. In the meanwhile, you should be able to work
around the problem by creating an ErrorListener object that you set on
TransformerFactory that throws TransformerExceptions if either its error
or its fatalError method is called. That should restore the behaviour you
observed with Xalan-J 2.5.1.
Thanks,
Henry
------------------------------------------------------------------
Henry Zongaro Xalan development
IBM SWS Toronto Lab T/L 969-6044; Phone +1 905 413-6044
mailto:[EMAIL PROTECTED]