Hi,
I'm just trying to find some problems in the latest Java version
of Xalan: when the TransformerIdentityImpl is used, output
properties are ignored when they are set by setOutputProperties().
We are heavily beaten by this problem in Cocoon.
I think this lies in the code of the setOutputProperties() method in
java/src/org/apache/xalan/transformer/TransformerIdentityImpl.java
(I removed some lines:)
public void setOutputProperties(Properties oformat) {
// See if an *explicit* method was set.
String method = (String) oformat.get(OutputKeys.METHOD);
if (null != method)
m_outputFormat = new OutputProperties(method);
else
m_outputFormat = new OutputProperties();
m_outputFormat.copyFrom(oformat);
}
If the new Properties (oformat) does contain a method, a new
OutputProperties for this method is generated, and then most
properties are ignored during the copyFrom() method as they
are already set.
So I think, the copyFrom() can not be used here, because if
m_outputFormat does already contain a value for key from
oformat, the value from oformat is ignore in copyFrom().
Am I right, or did I oversee somethink? I think, changing
m_outputFormat.copyFrom(oformat)
to
<copy all properties from oformat except METHOD to m_outputFormat>
would be correct.
I can send a patch if you like.
Regards
Carsten