Re: [xml] Encodings and Memory



On Wed, Jan 30, 2002 at 03:29:06PM -0500, fisty wrote:
      (a) Save all characters < 128 as normal characters (7 bit) and
      encode all characters >= 128 as entities (ie. &#266f;), or
      (b) Save all characters as UTF-8 encoded.

  (A) is ascii
  (b) is UTF-8
  (c) is UTF-16

All XML parsers MUST be able to read document in those formats, that's
the recommended encodings.

(2) Is there any way to decrease the amount of memory consumed while
building the DOM tree?  Memory consumption is pretty small using a SAX
reader, but writing some of my documents takes upwards of 18 megs of RAM
to build the entire tree in memory. Is there any way to streamline this at
all?

  No, or remove the parts of the tree you don't need. This can be done 
by playing with the SAX default handlers. I don't recommend it because
it requires a fairly good understanding of the libxml internals, and
works only if you need only a subpart known in advance of the tree.

Daniel

-- 
Daniel Veillard      | Red Hat Network https://rhn.redhat.com/
veillard redhat com  | libxml Gnome XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]