> It would be a nice "feature" if dom4j had the smarts to not print the 
> attribute if a
> namespace is not used.

How do you mean "not used" ?

<parent xmlns="test">
  <child/>
</parent>

In the above the child element is 'in' the default "test" namespace.

<parent xmlns="test">
  <child xmlns=""/>
</parent>

In the above the child element is in 'no' namespace at all by
un-declaring the default namespace.

I think what you wanted was the first case, where the child element is
in the default namespace. To specify this in dom4j however you would
have to specify the namespace for the "child" element, if you don't
specify a namespace for the "child" element then it is assumed that
the element is not 'in' a namespace (rightly/wrongly) and, when the
model is serialized, it will un-declare the default namespace if
necessary.

Regards,
Edwin
-- 
http://www.edankert.com/

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
dom4j-user mailing list
dom4j-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dom4j-user

Reply via email to