Rather than slurping the whole XML into a DOM for appending information, a SAX approach can be used. Simply pass through everything but the closing root tag. On encountering it, emit the new node and then the closing root tag.
This is much faster and much more memory friendly.
But yes, appending to XML is expensive.
Just my 2 cents, -gjb-
In reply to Re: Re: XML and file size
by gjb
in thread XML and file size
by silent11
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |