[jdom-interest] changing / controlling the order of adding children to Elements

Anand Sankaran anands at ntechra.com
Thu Mar 29 15:27:45 PST 2001


Hi all

Can we control the 'location' in which we add children to an 
Element?

For instance,

	Element rootElement = ....;
	
	rootElement.addContent(x);
	addATonOfElements(rootElement);
		
	//DTD says that y should be before
	//addATonOfElements and immediately after x

	rootElement.addContent(y);

If my business logic forces me to add 'y' as a child only after 
addATonOfElements() is called but my DTD defines this element to 
be added before addATonOfElements(), how do I handle this?

Any help would be appreciated.

Thanks

- anand



More information about the jdom-interest mailing list