[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: counting characters in an XML document
With a match on "/" you select the root of your document so to speak, that
is not the same as your root element.
with the <xsl:value-of select="string-length(child::*[1])"/> You say that you want the string-length of the returned concatenated string of your first root element. I don't think you need the [1] for if wellformed XML, your xml only has one root element. So the following would suffice: <?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> </xsl:stylesheet> cheers, RH At 08:38 AM 11/5/01 +0000, you wrote: The following appears to work: XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
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
|