The subjects says most of it.  I am trying to serialize the results of
stylesheet transformations and some xmlns declarations are going
missing.  

For example, if I am serializing the following markup:

<c:a 
xmlns:b="http://somenamespace.com/"; 
xmlns:c="http://othernamespace.com/"; 
b:d="e"/>

then I get the following:

<c:a 
xmlns:c="http://othernamespace.com/"; 
b:d="e"/>

The serialize method that I have written is:

public void serialize(
        OutputStream outputStream,
        Document document) 
throws Exception {
  java.util.Properties xmlProps =
    OutputPropertiesFactory.getDefaultMethodProperties("xml");
  xmlProps.setProperty("indent", "yes");
  xmlProps.setProperty("standalone", "no");
  Serializer serializer = 
    SerializerFactory.getSerializer(xmlProps);
  serializer.setOutputStream(outputStream);
  serializer.asDOMSerializer().serialize(document);
}

The document being serialized has always been parsed by a namespace
aware DOM builder or created by a transformer applied to a namespace
aware DOM and created from a stylesheet parsed in using a namespace
aware DOM builder.

The nearest archived message that I have come across is:
http://mail-archives.apache.org/mod_mbox/xml-security-dev/200409.mbox/%
[EMAIL PROTECTED]
but that relates to XMLSerializer.

Any guidance on what is going on would be very welcome!

Geoff Shuetrim

Reply via email to