xsl-list
[Top] [All Lists]

RE: XML file size from XSLT

2004-01-09 14:04:04
Yes, it should be possible to do as you said.
You'd have to recursively compute string length for each node,
and compute it differently depending on what kind of node it was.
Basically you could import an XML serializer stylesheet,
serialize the tree into text, store the result in a vairable,
and take the string length of that.  :-p
You're right, it sounds terrible.
Also, you wouldn't be able to account for things like the use
or non-use of entities, CDATA sections, how empty elements are
closed, where namespace declarations are placed, that sort of thing.
So the answer could be way, way off.

Lars


-----Original Message-----
From: owner-xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
[mailto:owner-xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com]On Behalf Of 
Jiang, Peiyun
Sent: Friday, January 09, 2004 1:07 PM
To: 'xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com'
Subject: [xsl] XML file size from XSLT


Is it possible to get the approximate XML file size from 
XSLT? Is it posible
to use some string functions to count the number of chars 
under document
element (though sounds terrible)?

Thanks.

Peiyun 

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list



<Prev in Thread] Current Thread [Next in Thread>