Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?xml version="1.0" encoding="UTF-8"?>
- <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:xs="http://www.w3.org/2001/XMLSchema" exclude-result-prefixes="xs" version="2.0">
- <xsl:template match="/">
- <xsl:result-document method="html" href="book_table.html">
- <html>
- <head>
- <title>Books</title>
- </head>
- <body>
- <xsl:for-each select="//book">
- <table>
- <tr>
- <th>BOOK NUMBER <xsl:value-of select="./@number"/></th>
- </tr>
- <tr>
- <td>title: <xsl:value-of select="./title"/></td>
- <td>location: <xsl:value-of select="./location"/></td>
- </tr>
- <tr>
- <td>publisher: <xsl:value-of select="./publisher"/></td>
- <td>year: <xsl:value-of select="./year"/></td>
- </tr>
- <xsl:for-each select=".//chapter">
- <tr>
- <td>Chapter <xsl:value-of select="./@chapternum"/></td>
- <td>pages: <xsl:value-of select="./pages"/></td>
- <td>words: <xsl:value-of select="./words"/></td>
- </tr>
- </xsl:for-each>
- </table>
- <p> </p>
- </xsl:for-each>
- </body>
- </html>
- </xsl:result-document>
- </xsl:template>
- </xsl:stylesheet>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement