Thomas Nichols wrote: > Ah - this is not what I'd been thinking of. So > foo.addEntity ("bar"); // returns foo > foo.addElement ("bar"); // returns ref to the new bar Element ?? I'd > expected it to return foo. > > If you return foo in all cases, you can chain addAttribute, addElement etc. > freely together. I'd much rather have the newly created Element back. I've already got a reference to the foo Element, and don't want to have to search it to get my newly created Element. Personally I don't think Element foo = foo.addElement("complexType"); foo.setAttributeValue("mixed", "true"); foo.setAttributeValue("bar", "bee"); is that bad, and the new ParseText() helper method cleans things up a lot too, if you just want clear code. Why do you need to create DefaultAttribute elements explicitly? James
- [dom4j-dev] Why do add(...) methods return void? Thomas Nichols
- Fw: [dom4j-dev] Why do add(...) methods return void? Jakob Jenkov
- Re: [dom4j-dev] Why do add(...) methods return void? James Strachan
- Re: [dom4j-dev] Why do add(...) methods return void? Thomas Nichols
- Re: [dom4j-dev] Why do add(...) methods return void? James Strachan
- Re: [dom4j-dev] Why do add(...) methods return void? Thomas Nichols
- Re: [dom4j-dev] Why do add(...) methods return void? Thomas Nichols
- Re: [dom4j-dev] Why do add(...) methods return void? James Elson
- Re: [dom4j-dev] Why do add(...) methods return void? James Strachan
- Re: [dom4j-dev] Why do add(...) methods return void? Thomas Nichols
- Re: [dom4j-dev] Why do add(...) methods return void? Thomas Nichols
- Fwd: Re: [dom4j-dev] Why do add(...) methods return vo... Thomas Nichols
- Re: [dom4j-dev] Why do add(...) methods return void? James Strachan
- Re: Re: [dom4j-dev] Why do add(...) methods return voi... James Strachan
- Re: [dom4j-dev] Why do add(...) methods return void? Thomas Nichols
- Re: [dom4j-dev] Why do add(...) methods return void? James Strachan