Share Pastebin
Guest
Public paste!

Untitled

By: a guest | Mar 25th, 2009 | Syntax: None | Size: 1.02 KB | Hits: 106 | Expires: Never
Copy text to clipboard
  1. <?xml version="1.0" encoding="ISO-8859-1"?>
  2.  
  3. <xsl:stylesheet version="1.0"
  4. xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
  5. xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  6.  
  7.  
  8. <xsl:output method="html" indent="yes" />
  9.  
  10. <xsl:template match="/">
  11.  
  12.         <html>
  13.                 <head>
  14.                         <style type="text/css">
  15.                                 body {
  16.                                         margin: 1.0em;
  17.                                 }
  18.                         </style>
  19.                 </head>
  20.  
  21.                 <body>
  22.                         <xsl:for-each select="//*[@rdf:about]">
  23.                                 <h1><a href="{@rdf:about}"><xsl:value-of select="name()"/></a></h1>
  24.                                 <ul>
  25.                                         <xsl:for-each select="./*">
  26.                                                 <xsl:choose>
  27.                                                         <xsl:when test="@rdf:resource">
  28.                                                                 <li><strong><xsl:value-of select="name()"/></strong>: <a href="{@rdf:resource}"><xsl:value-of select="@rdf:resource"/></a></li>
  29.                                                         </xsl:when>
  30.  
  31.                                                         <xsl:otherwise>
  32.                                                                 <li><strong><xsl:value-of select="name()"/></strong>: <xsl:value-of select="."/></li>
  33.                                                         </xsl:otherwise>
  34.                                                 </xsl:choose>
  35.                                         </xsl:for-each>
  36.                                 </ul>
  37.                         </xsl:for-each>
  38.  
  39.                 </body>
  40.         </html>
  41. </xsl:template>
  42.  
  43. </xsl:stylesheet>