|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Displaying one node at a time
Hi,
Tempore 20:02:06, die 07/04/2005 AD, hinc in xsl-list@xxxxxxxxxxxxxxxxxxxxxx scripsit Fadi Qutaishat <fadi_taher2000@xxxxxxxxx>: How can I display one chunk at a time, for example, using a next link. But word 'link' in this context seems to imply html. Just a wild guess, but I think your looking for a stylesheet that generates DHTML to dynamically browse your page's chunks: <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:output method="html" indent="yes" encoding="UTF-8" omit-xml-declaration="yes"/> <xsl:template match="/">
<html>
<head>title
<script type="text/javascript">
function show(id) {
var block=document.getElementsByTagName('div');
for (i=0;i < block.length;i++) {
block[i].style.display='none';
}
document.getElementById(id).style.display='block';
}
</script>
</head>
<body onload="show('{//chunk/@id[1]}')">
<xsl:apply-templates/>
</body>
</html>
</xsl:template><xsl:template match="page"> <h1>My page</h1> <ul> <xsl:for-each select="chunk"> <li><a href="javascript: show('{@id}')">chunk <xsl:value-of select="@id"/></a></li> </xsl:for-each> </ul> <xsl:apply-templates/> </xsl:template> <xsl:template match="chunk"> <div id="{@id}" style="display: none"> <h2>chunk <xsl:value-of select="@id"/></h2> <p><xsl:apply-templates/></p> <xsl:if test="position()!=1"> <a href="javascript: show('{preceding-sibling::chunk[1]/@id}')"><<previous chunk |</a> </xsl:if> <xsl:if test="position()!=last()"> <a href="javascript: show('{following-sibling::chunk[1]/@id}')">| next chunk>></a> </xsl:if> </div> </xsl:template> </xsl:stylesheet> regards, -- Joris Gillis (http://users.telenet.be/root-jg/me.html) Spread the wiki (http://www.wikipedia.org)
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








