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

S/MIME Cryptographic Signature

Reply via email to