Answer 14: String Manipulation

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

   <xsl:template match="/">
    <html>
        <head>
           <title>First Sentences</title>
        </head>
        <body>
        <ul>
          <xsl:apply-templates select="descendant::para"/>
         </ul>
         </body>
    </html>
  </xsl:template>

  <xsl:template match="para">
    <li>
      <xsl:value-of select="substring-before(concat(normalize-space(), '. '), '. ')"/>
    </li>
  </xsl:template>
  
</xsl:stylesheet>
View Transformed Document in Browser
Previous | Next | Top | Cafe con Leche

Copyright 2002, 2003 Elliotte Rusty Harold
Elliotte Rusty Harold
Last Modified October 16, 2002