uhferret.xsl 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <?xml version="1.0" encoding="ISO-8859-1"?>
  2. <html xsl:version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <style> <!-- style sheet for document -->
  5. h1 {background-color: #d0d0d0} <!-- add a background to make headings stand out -->
  6. h2 {background-color: #d0d0d0}
  7. .highlight {font-weight:bold; color:blue} <!-- highlighted text style -->
  8. .normal {font-weight:normal} <!-- normal text style -->
  9. </style>
  10. </head>
  11. <body>
  12. <h1>UH-Ferret: Document comparison</h1>
  13. <!-- display top-level information -->
  14. <p>Common trigrams: <xsl:value-of select="uhferret/common-trigrams"/></p>
  15. <p>Similarity: <xsl:value-of select="uhferret/similarity"/></p>
  16. <!-- work through each document -->
  17. <xsl:for-each select="uhferret/document">
  18. <!-- display document-level information -->
  19. <h2>Document: <xsl:value-of select="source"/></h2>
  20. <p>Number of trigrams: <xsl:value-of select="num-trigrams"/></p>
  21. <p>Containment in other document: <xsl:value-of select="containment"/></p>
  22. <!-- work through each block in text, displaying as highlighted or normal -->
  23. <pre>
  24. <xsl:for-each select="text/block">
  25. <xsl:if test="@text='copied'">
  26. <span class="highlight"><xsl:value-of select="."/></span>
  27. </xsl:if>
  28. <xsl:if test="@text='normal'">
  29. <span style="normal"><xsl:value-of select="."/></span>
  30. </xsl:if>
  31. </xsl:for-each>
  32. </pre>
  33. </xsl:for-each>
  34. </body>
  35. </html>