cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Boisvert, Éric" <>
Subject RE: CInclude POST (again)
Date Wed, 07 Dec 2005 15:28:44 GMT
gee thanks for the fix.  being a defensive programmer , I changed the code

private String GetXmlRequest(Document doc)
  String req = this.DomToString(doc); 
  if (req.indexOf("xmlns") == -1)
      // not namespace declaration found 
      Node n = doc.getFirstChild();
      req.replaceFirst(n.getLocalName(),n.getLocalName() + " " + ns);
 	return req; 

I have 2.1.6 and 2.1.8 implementations running.

-----Message d'origine-----
De : Stewart, Gary []
Envoyé : 7 décembre, 2005 07:08
À :
Objet : RE: CInclude POST (again)

> -----Original Message-----
> From: Boisvert, Éric []
> Sent: 06 December 2005 17:17
> To:
> Subject: RE: CInclude POST (again)
> find attached the source code, keep in mind that's I'm not a 
> expert Java
> programmer (I'm more on C# and Delphi).  The component has 
> been designed to
> send POST query to WFS (Web Feature Service) servers, which 
> are typically
> small XML Query versus potentially very large XML Responses.  
> This is an
> issue in the code because the incoming XML is converted to a 
> DOM and then to
> a string (to fix a bug in DOM serializer that 'forgets' to serialize
> namespaces), I must manually reinsert the namespaces 
> declaration in the
> incoming XML.  
> I've added a bit more comments in the source code, for your either
> documentation or comic relief.
> I assume you are familliar with compiling+installing Cocoon 
> components.
> Also, this component is provided as is, and I cannot garantee it will
> function properly under stress conditions.. So if your business it the
> control Airplane traffic or controling a nuclear reactor, I 
> suggest you have
> this checked by a REAL java programmer. :P

If it was in nuclear reactors the Java licence agreement explicitly states:

"You acknowledge that Licensed Software is not designed or intended for use
in the design, construction, operation or maintenance of any nuclear

so nuclear facility programmers shouldn't be using Java let alone cocoon or
custom transformers on top of that :D.

I think XMLUtils.serializeNode might have been changed in 2.1.8 (the
revision date shows 2005-11-13) and serialization now seems to return the
namespace because at first I was getting a namespace already declared
exception so I changed GetXmlRequest to the very short; I could give you a
diff but it's only this function that I've changed:

private String GetXmlRequest(Document doc)
 String req = this.DomToString(doc); 
 return req; 

Thank you very much for the code; it has proved very useful. I'd still be
interested in confirming whether CInclude's patch has been put through
correctly but this certainly seems like the best route (it stops me needing
to create CInclude wrappers as well).

Thanks again for the code and the help,


The information contained in this message may be confidential or 
legally privileged and is intended for the addressee only, If you 
have received this message in error or there are any problems, 
please notify the originator immediately. The unauthorised use, 
disclosure, copying or alteration of this message is 
strictly forbidden.

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

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

View raw message