email.xsl 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. <?xml version="1.0"?>
  2. <!--
  3. Name: email.xsl
  4. Purpose: Create email address lookup.
  5. Author: Mike Wetherell
  6. Copyright: (c) 2007 Mike Wetherell
  7. Licence: wxWindows licence
  8. Usage: xsltproc -html tools/email.xsl http://svn.wxwidgets.org/users.cgi \
  9. > config/include/wx-devs.xml
  10. -->
  11. <xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
  12. <xsl:param name="at"> -at- </xsl:param>
  13. <xsl:output indent="yes"/>
  14. <xsl:template match="/">
  15. <emaillookup>
  16. <xsl:apply-templates select="//table/tr">
  17. <xsl:sort select="normalize-space(td[1])"/>
  18. </xsl:apply-templates>
  19. </emaillookup>
  20. </xsl:template>
  21. <xsl:template match="tr">
  22. <xsl:variable name="id" select="normalize-space(td[1])"/>
  23. <xsl:variable name="email" select="normalize-space(td[3])"/>
  24. <xsl:if test="$id and not(contains($id, ' ')) and contains($email, $at)">
  25. <email id="{$id}">
  26. <xsl:value-of select="$email"/>
  27. </email>
  28. </xsl:if>
  29. </xsl:template>
  30. </xsl:transform>