Subject: Re: [xsl] counting characters in an XML document From: ronald heller <ronald@xxxxxxxxxxx> Date: Mon, 05 Nov 2001 10:18:18 +0100 |
<?xml version="1.0" encoding="utf-8"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="text"/> <xsl:strip-space elements="*"/>
<xsl:template match="/"> <xsl:value-of select="string-length(*)"/> </xsl:template>
The following appears to work:
<?xml version="1.0" encoding="utf-8"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="text"/> <xsl:strip-space elements="*"/>
<xsl:template match="/"> <xsl:value-of select="string-length(child::*[1])"/> </xsl:template>
</xsl:stylesheet>
///Peter
=======
That solution confuses me - I would have expected descendants to work, rather than child::*[1]. <xsl:value-of select="string-length(descendants)"/>
Can somebody comment on what is happening in this line?
Thanks
Robert Stuart
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] counting characters in an, David Carlisle | Thread | Re: [xsl] How to read the encoding , Peter Flynn |
RE: [xsl] Please help in XSL, Jarno . Elovirta | Date | RE: [xsl] FO question, reg. display, Scherpenzeel, Wim |
Month |