RE: [xsl] XML file size from XSLT

Subject: RE: [xsl] XML file size from XSLT
From: "Lars Huttar" <lars_huttar@xxxxxxx>
Date: Fri, 9 Jan 2004 15:04:04 -0600
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@xxxxxxxxxxxxxxxxxxxxxx
> [mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx]On Behalf Of 
> Jiang, Peiyun
> Sent: Friday, January 09, 2004 1:07 PM
> To: 'xsl-list@xxxxxxxxxxxxxxxxxxxxxx'
> 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


Current Thread