|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Measure the length of an XML document in bytes
Hi, Tempore 14:49:54, die 08/04/2005 AD, hinc in xsl-list@xxxxxxxxxxxxxxxxxxxxxx scripsit Khorasani, Houman <houman_khorasani@xxxxxxxxxxxxxx>: Any ideas how to count the length of a document character by character?
<xsl:template match="/"> <xsl:variable name="doc"> <xsl:apply-templates select="." mode="serialize"/> </xsl:variable> estimated size: <xsl:value-of select="string-length($doc)"/> </xsl:template> <xsl:template match="comment" mode="serialize"> <xsl:text/><!--<xsl:apply-templates mode="serialize"/>--><xsl:text/> </xsl:template> <xsl:template match="processing-instruction()" mode="serialize"> <xsl:text/><?<xsl:value-of select="name()"/> <xsl:text> </xsl:text><xsl:value-of select="."/>?><xsl:text/> </xsl:template> <xsl:template match="*" mode="serialize"> <xsl:text/><<xsl:value-of select="name()"/> <xsl:apply-templates select="@*" mode="serialize"/>><xsl:text/> <xsl:apply-templates mode="serialize"/> <xsl:text/></<xsl:value-of select="name()"/>><xsl:text/> </xsl:template> <xsl:template match="@*" mode="serialize"> <xsl:text> </xsl:text><xsl:value-of select="name()"/> <xsl:text/>="<xsl:value-of select="."/>"<xsl:text/> </xsl:template> </xsl:stylesheet>
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








