<?xml version="1.0"?>
<xsl:stylesheet version="2.0" 
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
xmlns:local="http://www.stylusstudio.com/">

	<xsl:function name="local:ValueToIndex">
		<xsl:param name="Value"/>
		<xsl:value-of select="string-length($Value)"/>
	</xsl:function>
	
	<xsl:template match="/">
		<html>
			<head/>
			<body>
				<div style="text-align: none;">
					<table align="none" width="100%" border="2pt" cellspacing="1pt" cellpadding="1pt">
						<tbody>
							<xsl:for-each select="/books/book">
								<xsl:sort select="local:ValueToIndex(title)"/>
								<tr>
									<td>
										<div style="text-align: none;">
											<xsl:value-of select="title"/>
										</div>
									</td>
								</tr>
							</xsl:for-each>
						</tbody>
					</table>
				</div>
			</body>
		</html>
	</xsl:template>
</xsl:stylesheet><!-- Stylus Studio meta-information - (c) 2004-2006. Progress Software Corporation. All rights reserved.
<metaInformation>
<scenarios ><scenario default="yes" name="Scenario1" userelativepaths="yes" externalpreview="no" url="..\Program Files\Stylus Studio 2007 XML Enterprise Suite\examples\simpleMappings\books.xml" htmlbaseurl="" outputurl="" processortype="saxon8" useresolver="yes" profilemode="0" profiledepth="" profilelength="" urlprofilexml="" commandline="" additionalpath="" additionalclasspath="" postprocessortype="none" postprocesscommandline="" postprocessadditionalpath="" postprocessgeneratedext="" validateoutput="no" validator="internal" customvalidator=""/></scenarios><MapperMetaTag><MapperInfo srcSchemaPathIsRelative="yes" srcSchemaInterpretAsXML="no" destSchemaPath="" destSchemaRoot="" destSchemaPathIsRelative="yes" destSchemaInterpretAsXML="no"/><MapperBlockPosition></MapperBlockPosition><TemplateContext></TemplateContext><MapperFilter side="source"></MapperFilter></MapperMetaTag>
</metaInformation>
-->