Re: your mail

Subject: Re: your mail
From: Mike Brown <mike@xxxxxxxx>
Date: Sat, 10 Jun 2000 21:29:01 -0600 (MDT)
> <xsl:template match="*" />
> 
> I was looking at an xsl file; it had the above line and right above it the 
> comment:
> 
> <!-- The template with match="*" below is a fail-safe.  If at any point we 
> get to a node in the XML tree that doesn't match any of our template match 
> statements, we replace that node with blank space. -->
> 
> 
> This is in the context of going through an xml file and creating an html 
> table. I think I understand what this means, but when (or maybe even why) 
> would a condition like this happen? I commented out <xsl:template match="*" 
> /> and I still got the same table.

If you understand the processing model of XSLT, whereby processing begins
at the root node and from there everything that happens is a result of
processing templates (some of which may be built-in as prescribed by the
spec), then it should be apparent that the authors of this XSLT document
are simply overriding the built-in template for all elements.

Why would they want to do this? Perhaps because they know that the XML
schema may change, and they don't want any new, unaccounted-for element
types that don't have explicitly matching templates of their own to be
processed by the built-in template.

   - Mike
____________________________________________________________________
Mike J. Brown, software engineer at         My XML/XSL resources:
webb.net in Denver, Colorado, USA           http://www.skew.org/xml/


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread