Hmmm, well maybe for debugging purposes, hehe. ;o).

Still, philosophically I think 'do nothing by default' is the best strategy 
for software 99% of the time. I'm sure the default rule was put in place by 
publishing industry people that 99% of the time want to end up with text by 
default and just have some markup sprinkled in here and there.

I just found that in early stages of the pipeline you want 'copy all tags' 
behaviour and at the end you want 'suppress all except explicitly mentioned'. 
It will be interesting to see how XSLT 2.0 handles this sort of thing. They 
certainly seem to be gearing it mainly towards data processing applications 
and away from the publishing "stylesheet" concept of XSLT 1.0.

On Tuesday 05 August 2003 05:27 pm, S Woodside wrote:
> What are you talking about Tod ;-) That's crazy talk. XSLT is much more
> fun if you actually write lots of templates. If you need to add
> boilerplate code it's easy enough to do something like this:
>
> <xsl:template match="/">
>    <!--add html headers or whatever-->
>    <xsl:apply-templates/>
>    <!--add html footers or whatever-->
> </xsl:template>
>
> then if you want to kill off certain nodes that you're not using it's
> easy enough:
>
> <xsl:apply-templates match="dontwantthis"/>
>
> Having the default rule I think is useful as a double-check, so that if
> I get extraneous text output it's a red flag that I goofed somewhere.
>
> simon
>
> On Tuesday, August 5, 2003, at 03:01 PM, Tod Harter wrote:
> > What I meant was, you're right, but I've brainwashed myself so bad
> > with my
> > cookie cutter approach ;o) that I forget the rules... Really, XSLT (at
> > least
> > for my purposes) should just ignore anything that there isn't an
> > explicit
> > match for. I always put in a 'do nothing' and then just run an open
> > apply
> > templates loop at the top to get that behaviour, which is 99.99% of
> > the time
> > what you want when building web pages. I guess XSLT is showing its
> > roots, not
> > surprising given the terminology they use (stylesheet??? its a PROGRAM
> > guys!).
> >
> > So the original post is correct in general, though in my little cozy
> > world my
> > way works too.
> >
> >> Sorry, should be <xsl:apply-templates/> not <xsl:copy-of .../> sigh.
> >>
> >>> Sorry, but this is wrong. With your experience, you surely know that
> >>> copy-of copies a whole subtree, and nothing in your template
> >>> continues
> >>> processing, so you would bypass most other template rules. Just
> >>> imagine a
> >>> XML snippet <a><b><c/></b></a>. A match on "a" would work, a match
> >>> on "c"
> >>> would not, as the XSLT processor would never get that far.
> >
> > --
> > Giant Electronic Brain
> > Internet/E-Commerce Consulting Services
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
>
> --
>       anti-spam: do not post this address publicly
> www.simonwoodside.com -- 99% Devil, 1% Angel

-- 
Tod Harter
Giant Electronic Brain
http://www.giantelectronicbrain.com

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to