Re: [xsl] The notion of Inheritance?

Subject: Re: [xsl] The notion of Inheritance?
From: Jeni Tennison <mail@xxxxxxxxxxxxxxxx>
Date: Thu, 29 Mar 2001 19:18:56 +0100
Hi William,

> I was a bit hasty with my reply.

Ahh, good.  I was a bit confused by it.

> I also cannot figure out how to prevent the rest of the data from passing
> through.

If you select what to process with an xsl:apply-templates, then the
processor won't process the bits you don't select.  I just posted
giving a demonstration of that.

>   Normally I would use something like:
>
> <xsl:template match="*|@*|text()">
> <!-- do nothing! -->
> </xsl:template>
>
> but that doesn't work here, as you've already matched *[*] and
> *[not(*)], which seems to cover pretty much everything, although I
> could be (and probably am!) mistaken.

Those templates are assigned a different ('inherit') mode, so they'll
only be applied when templates are applied in 'inherit' mode.  So you
could use an empty default template like the one above if you wanted.

However, usually if you only want to process a little bit of your file
it's more efficient to tell the processor to only process that bit (a
pull approach) rather than getting it to process everything (which is
what it does by default) and only give templates for the things you're
interested in (a push approach).

Cheers,

Jeni

---
Jeni Tennison
http://www.jenitennison.com/



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


Current Thread