cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Simon Collins" <>
Subject DOMStreamer namespace problems
Date Wed, 14 Apr 2004 12:44:28 GMT
Hi all,

I was having a problem with Cocoon Forms down where I was losing the
namespace prefix mapping declaration on the root element when I saved the
form contents to a DOM document and then serialized that out to an XML

I've found a workaround for now but there seems to be a bug somewhere. It
doesn't appear to be a forms related issue but rather one with
org.apache.cocoon.xml.DOMStreamer which is used like this in my code (and
in the Form GUI Cocoon sample):

-- snip --

var source = null;
var resolver = null;
var outputStream = null;
  try {
    resolver =
    source = resolver.resolveURI(uri);
    var tf =

    if (source instanceof

       outputStream = source.getOutputStream();
       var transformerHandler = tf.newTransformerHandler();
       var transformer = transformerHandler.getTransformer();

       var streamer = new;;

-- snip --

By default, DOMStreamer uses the NamespaceNormalizingDOMStreamer inner
class to write out SAX events. If I turn this off with


then it uses DefaultDOMStreamer and the document is correctly written out
with the namespace declaration added.

>From a bit of debugging it seems like NamespaceNormalizingDOMStreamer is
spitting out the correct SAX events but for some reason they're not
making it into to the output XML.

If you want to try and replicate the problem just use the Cocoon Forms
GUI Builder sample and submit the form. Then look at
forms/form_model_gui_data-result.xml. The namespace declaration for
prefix "fd" should be missing on the root element.

I'm using Apache Tomcat/4.1.27, JDK 1.4.2_04-b05 with the nightly build
of 2.1.5 for 6/4/04.

Anyone got any ideas as to why this might be happening?



To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message