I am using DOM4J to do analysis of two XML elements. The elements are the following:
<element1 attr="val">text</element1> //org.dom4j.Element = e1
<element1 attr="val">OtherText</element1> //org.dom4j.Element = e2
I have a given xml structured like this:
<elem> <val id="1">aaa</val> <val id="2">bbb</val> </elem>
I am reading an XML using dom4j by using XPath techniques for selecting desired nodes. Consider that my XML looks like this:
<Emp_Dir> <Emp_Classification type ="Permanent" > ...
I want to add xmlns attribute to the root node only, however when i add a namespace to the root element, all subsequent child elements also get the same xmlns attribute. ...