Size of XML element in memory

Discussions and bug reports related to NativeXml

Size of XML element in memory

Postby Tilen » Mon Feb 08, 2010 12:32 pm

Hi

I would like to know what is the size of any of xml nodes/elements. I need this info to get info on biggest elements in xml files. The xml file size is not good.

So, I was thinking of some sort of
Code: Select all
SizeOf(XMLFile.Nodes[x])
function that would return how many bytes/bits of memory whole selected node,element uses. Any suggestions how I can achieve this?

Thank you

Tilen
Tilen
Junior Member
 
Posts: 5
Joined: Tue Nov 28, 2006 12:25 pm

Re: Size of XML element in memory

Postby Nils Haeck » Tue Feb 16, 2010 3:55 pm

Hello Tilen,

The "size of an element" is somewhat arbitrary, because you can ask just what exactly comprises the element: is it just the value, or also the name, size of attributes and also sub-elements, etcetera. And when an element has base64- or binhex encoded data, is it the size of the encoded data or unencoded data?

There is a method for the XmlNode when encoded with base64 or binhex, and it is called "BufferLength". You can use that method when you read/write data from the element with "BufferRead" and "BufferWrite".

Success, Nils
User avatar
Nils Haeck
Site Admin
 
Posts: 953
Joined: Tue Jan 20, 2004 3:59 pm
Location: Hellevoetsluis, Netherlands


Return to NativeXml

Who is online

Users browsing this forum: No registered users and 1 guest