HomePage RecentChanges XSLT Default Rules

A gotcha on XSLT is the default rules. A good article describing them is here: http://www.dpawson.co.uk/xsl/sect2/defaultrule.html

The short version:

A default template exists to expand all elements

<xsl:template match="*">

That way you can make a template that matches an element and you will get to it.

A default template exists for text

<xsl:template match="text()">
  <xsl:value-of select="."/>

Which always expands the text elements.

How to avoid

The first one is sensible and you should leave it. But you can change the behaviour by writing your own.

The second, text expansion can be changed in one of two ways:

Removing the text node:

<xsl:template match="text()" />

Software error:

Can't locate object method "endform" via package "CGI" at /data/scott.dd.com.au/wiki/modules/search.pl line 15.

For help, please send mail to the webmaster (webmaster@dd.com.au), giving this error message and the time and date of the error.