Skip to Content.
Sympa Menu

xom-interest - Re: [XOM-interest] XML "size"

xom-interest AT lists.ibiblio.org

Subject: XOM API for Processing XML with Java

List archive

Chronological Thread  
  • From: Wolfgang Hoschek <whoschek AT lbl.gov>
  • To: Luca Passani <passani AT eunet.no>
  • Cc: xom-interest AT lists.ibiblio.org
  • Subject: Re: [XOM-interest] XML "size"
  • Date: Thu, 12 May 2005 07:45:39 -0700

Copy and paste the method and it's impl into your project. It's just a few lines of code with zero dependencies.
Wolfgang.

On May 12, 2005, at 7:28 AM, Luca Passani wrote:


Thank you, my friend. You are one of the few who understands me!

what do you mean by cut&paste? do I need to recompile XOM?
or I just need to cut&paste into my own code?

Luca


Wolfgang Hoschek wrote:


Nux XOMUtil.getMemorySize(Node)

/**
* Returns a reasonable approximation of the main memory consumed by the
* given XOM subtree. Assumes that qname Strings are interned, but Text
* values and Attribute values are not. For simplicity, assumes no VM word
* boundary alignment of instance vars. Useful for memory- sensitive caches.
*/

It's not a public method but you could copy and paste it, if that's what you are looking for.
The impl is simple.
Wolfgang.


On May 12, 2005, at 7:08 AM, Luca Passani wrote:


Noam Tamim wrote:



Luca: why would you want that in the first place?



I have content in XML format which I need to display on a mobile device. The problem is that I need to
deal with memory costraints there, so I need to know how much stuff and sending down the pipe or
the poor bastard will choke...

Luca
_______________________________________________
XOM-interest mailing list
XOM-interest AT lists.ibiblio.org
http://lists.ibiblio.org/mailman/listinfo/xom-interest






_______________________________________________
XOM-interest mailing list
XOM-interest AT lists.ibiblio.org
http://lists.ibiblio.org/mailman/listinfo/xom-interest






Archive powered by MHonArc 2.6.24.

Top of Page