I've worked it out:

<xsl:template match="div[a/@id='test']" mode="ixsl:onclick">
<xsl:variable name="event" select="ixsl:event()"/>
<xsl:value-of select="ixsl:call($event, 'preventDefault')"/>
  <xsl:apply-templates select="." mode="replaceContent"/>
</xsl:template>

<xsl:template match="div" mode="replaceContent">
 <xsl:result-document href="?select=." method="ixsl:replace-content">
     ...............</xsl:result-document>
</xsl:template>

should have read the documentation in a bit more detail...


From: tomxsllist@hotmail.com
To: saxon-help@lists.sourceforge.net
Date: Thu, 25 Aug 2011 15:23:09 +0100
Subject: [saxon] Saxon CE and onclick

I have an HTML document that is referencing a source XML and a client side XSLT in the conventional saxon CE way. In the HTML doc I have a link:
<div><a href="/path/to/somewhere.xml" id="test">link</a></div>

In the XSLT file I wish to suppress the href onclick event that loads a new page, instead of which I wish to do something else. 

If I match the link like this:

<xsl:template match="div[a/@id='test']" mode="ixsl:onclick">
  <xsl:apply-templates select="." mode="replaceContent"/>
</xsl:template>

<xsl:template match="div" mode="replaceContent">
 <xsl:result-document href="?select=." method="ixsl:replace-content">
     ...............</xsl:result-document>
</xsl:template>


How do I suppress the onclick event of the <a> element? 

Thanks




------------------------------------------------------------------------------ EMC VNX: the world's simplest storage, starting under $10K The only unified storage solution that offers unified management Up to 160% more powerful than alternatives and 25% more efficient. Guaranteed. http://p.sf.net/sfu/emc-vnx-dev2dev
_______________________________________________ saxon-help mailing list archived at http://saxon.markmail.org/ saxon-help@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/saxon-help