Re: [xsl] Applying templates by selecting it

Subject: Re: [xsl] Applying templates by selecting it
From: Sylvain Hellegouarch <sh@xxxxxxxxxx>
Date: Wed, 20 Jul 2005 17:54:56 +0200
Great thanks :)

I'll read that carefully later on. XSLT is quite a big beast and sometimes you
forget the basics when doing more complex stuff.

In any case, it looks I still need some lessons on XSLT :)

Cheers again.
- Sylvain

Selon Wendell Piez <wapiez@xxxxxxxxxxxxxxxx>:

> Dear Sylvain,
>
> At 11:16 AM 7/20/2005, you wrote:
> >Yeah cheers. In fact in my first sample version, I was using 'node' instead
> of
> >'a' for naming my template. But then I did realise that it would be more
> >confusing due to the very function you mentioned (node()).
>
> Ah, okay. (FWIW: node() is not a function, it's a node test. :-)
>
> >So in my email I changed the XML document from 'node' to 'a' but forgot to
> >change the template as well.
>
> Yet since the default builtin template for elements is
>
> <xsl:template match="*">
>    <xsl:apply-templates/>
> </xsl:template>
>
> and that for text nodes is (notice that *node test* in the pattern,
> "text()"):
>
> <xsl:template match="text()">
>    <xsl:value-of select="."/>
> </xsl:template>
>
> it turns out that, at least in your toy example, no extra template is
> needed for that "a" element (since it will descend to its text node child
> by default, which by default gets written out).
>
> >Anyway, lots of bandwith usage for nothing... my fault :)
>
> Oh I don't know -- sometimes these little conversations are useful, and you
> never know to whom. There are plenty of people lurking on the list
> especially in order to scoop up nuggets of insight found in such discussions.
>
> Cheers again,
> Wendell
>
>
>
> ======================================================================
> Wendell Piez                            mailto:wapiez@xxxxxxxxxxxxxxxx
> Mulberry Technologies, Inc.                http://www.mulberrytech.com
> 17 West Jefferson Street                    Direct Phone: 301/315-9635
> Suite 207                                          Phone: 301/315-9631
> Rockville, MD  20850                                 Fax: 301/315-8285
> ----------------------------------------------------------------------
>    Mulberry Technologies: A Consultancy Specializing in SGML and XML
> ======================================================================
>
>




----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.

Current Thread