Documentation Center

The stylesheet

When implementing pop-up menus you need to add some XSL.

You only need to make minor changes to the XSL. As shown below, you add a button to the bottom of each section.

<xsl:template match="section">
	<div class="section" id="{generate-id(.)}">
		<xsl:apply-templates select="node()" />
			<div class="showMenuButton">
    		<button
				class="menuButton"
				type="button" 
   				onclick="insert_menu(this, node)" 
	  				align="left">Menu</button>
			</div>
  </div>
 </xsl:template>

There's a new div, of class showMenuButton and inside of that, the button itself. For best results set the button type to button. Otherwise the button type defaults to submit, which might produce unexpected results.

For the onclick, you pass two arguments:

  • this passes the HTML element of the div that surrounds the button
  • node passes the Xopus node for the XML document.