Hi,

I am wondering if I found a bug or a feature in the latest cvs
of Xalan-J.

If I use the following code snippet, which reads the xml
document "a.xml" and "transformes" it to two new documents
"a-1.xml" and "a-2.xml", the second call to the transform()
method does not use the previously set output properties. It seems
that they are reset after each call to transform().

Is this a feature or a bug?

PS: Setting the output properties before each transform()
    works of course.

>>>>> CODE SNIPPET <<<<<<<<<<<<<
import java.util.Properties;
import javax.xml.transform.Transformer;
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.stream.StreamSource;
import javax.xml.transform.stream.StreamResult;
import javax.xml.transform.OutputKeys;


public class Test
{
    public static void main(String[] args)
    throws Exception
    {
        Transformer
transformer=TransformerFactory.newInstance().newTransformer();
        Properties format=new Properties();
        format.put(OutputKeys.METHOD, "xml");
        format.put(OutputKeys.ENCODING, "ISO-8859-1");
        format.put(OutputKeys.OMIT_XML_DECLARATION, "no");
        format.put(OutputKeys.INDENT, "yes");
        transformer.setOutputProperties(format);

        transformer.transform(
                   new StreamSource("a.xml"),
                        new StreamResult("a-1.xml"));
        transformer.transform(
                   new StreamSource("a.xml"),
                        new StreamResult("a-2.xml"));
    }
}
>>>>> END CODE SNIPPET <<<<<<<<<<<<<


Carsten

Open Source Group                        sunShine - b:Integrated
================================================================
Carsten Ziegeler, S&N AG, Klingenderstrasse 5, D-33100 Paderborn
www.sundn.de                          mailto: [EMAIL PROTECTED]
================================================================

Reply via email to