You are viewing a plain text version of this content. The canonical link for it is here.
Posted to soap-user@ws.apache.org by Damien Vincent <dv...@calendra.com> on 2001/08/10 13:01:14 UTC

TR: does DOM2Writer have a bug ?

> Hi,
> I use the XMLParameterSerializer to encode DOM into XML in a Soap
> client (as a Parameter)
> The Elements of my DOM belong to a specific namespace, but WITHOUT any
> Prefix (according to namespace specifications).
> Into the SOAP message, I'm surprised to notice that my DOM is
> serialized without the namespace URI reference.
> 
> The serialisation is correct when Elements have a prefix.
> 
> In other words:
> If my DOM contains an Element such as: <Element xmlns="xxxx" /> 
> It is serialized into : <Element /> (where is the namespaceURI?)
> but, if my DOM contains an Element such as : <pr:Element
> xmlns:pr="xxxx" />
> It is correctly serialized into : <pr:Element xmlns:pr="xxxx" />
> 
> 
> I've found that the DOM 2 XML serialization is done by the class
> DOM2Writer.
> In the class, I found : 
> 
> private static void print(Node node, ObjectRegistry namespaceStack,
> PrintWriter out)
> ...
>       case Node.ELEMENT_NODE :
>       {
> ...
>         if (elPrefix != null && elNamespaceURI != null){    <-- prefix
> could be null and NamespaceURI not.(!!)
> 	//print the namespace
> 	
> The IF test seems to be incorrect....
> 
> Does anybody have the same problem.   
> Thank's
> 
> Damien
> 
> 
> 
>