<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="MS Exchange Server version 5.5.2653.12">
<TITLE>RE: [jdom-interest] xmlns="" in children elements of root</TITLE>
</HEAD>
<BODY>
<P><FONT SIZE=2> </FONT>
</P>
<P><FONT SIZE=2>-----Original Message-----</FONT>
<BR><FONT SIZE=2>From: Rodney S. Foley</FONT>
<BR><FONT SIZE=2>To: 'jdom-interest@jdom.org'</FONT>
<BR><FONT SIZE=2>Cc: 'Jason Hunter'</FONT>
<BR><FONT SIZE=2>Sent: 8/29/01 11:09 AM</FONT>
<BR><FONT SIZE=2>Subject: RE: [jdom-interest] xmlns="" in children elements of root</FONT>
</P>
<BR>
<P><FONT SIZE=2>Also if I move the element around in my code and I never gave it a</FONT>
<BR><FONT SIZE=2>namespace I would expect it to have the same namespace as it's new parent.</FONT>
<BR><FONT SIZE=2>I think coding with any API should be as intuitive as possible. </FONT>
</P>
<P><FONT SIZE=2>Where this:</FONT>
</P>
<P><FONT SIZE=2>Namespace ns = Namespace.getNamespace("<A HREF="http://foo.com" TARGET="_blank">http://foo.com</A>");</FONT>
<BR><FONT SIZE=2>Element y = new Element("y", ns);</FONT>
<BR><FONT SIZE=2>x.addContent(y);</FONT>
<BR><FONT SIZE=2>Element z = new Element("z", ns);</FONT>
<BR><FONT SIZE=2>y.addContent(z);</FONT>
</P>
<P><FONT SIZE=2>And this:</FONT>
</P>
<P><FONT SIZE=2>Namespace ns = Namespace.getNamespace("<A HREF="http://foo.com" TARGET="_blank">http://foo.com</A>");</FONT>
<BR><FONT SIZE=2>Element y = new Element("y", ns);</FONT>
<BR><FONT SIZE=2>x.addContent(y);</FONT>
<BR><FONT SIZE=2>Element z = new Element("z");</FONT>
<BR><FONT SIZE=2>y.addContent(z);</FONT>
</P>
<P><FONT SIZE=2>Are the same. Because that is intuitive to anyone who knows how to READ</FONT>
<BR><FONT SIZE=2>or create from scratch an XML File.</FONT>
</P>
<P><FONT SIZE=2>-----------------------------------------------</FONT>
</P>
<P><FONT SIZE=2>Note that Element z at the time of its creation is not necessarily a child of y and cannot inherit y's namespace. What you are actually proposing is that y.addContent(z) should check if z has a name space assigned if not then assign y's namespace.</FONT></P>
</BODY>
</HTML>