Forum Moderators: open
Please let me know how do I generate separate html pages using XSLT for each child node of the parent "chapter".
The following code just retrieves a subset of XML pages
<?xml version="1.0" encoding="iso-8859-1"?>
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html"/>
<xsl:template match="/">
<xsl:for-each select="chapter/section">
<xsl:result-document href="./outputExe/Chap1Section{position()}.htm">
<html>
<body>
<xsl:copy-of select="*"/>
</body>
</html>
</xsl:result-document>
</xsl:for-each>
</xsl:template>
<xsl:template match="text()¦@*"/>
</xsl:stylesheet>
Thanks in advance chandru
<?xml version="1.0" encoding="iso-8859-1"?>
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html"/>
<xsl:variable name="section">[red][b]S123[/b][/red]</xsl:variable>
<xsl:template match="/">
<html>
<body>
<xsl:copy-of select="chapter/section[@id=$section]"></xsl:copy-of>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
you can pass the section ID into your XSL as a parameter, and serve multiple pages that show only one section each