xsl-list
[Top] [All Lists]

Re: Applying templates by selecting it

2005-07-20 08:54:56
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(_at_)mulberrytech(_dot_)com>:

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(_at_)mulberrytech(_dot_)com
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
======================================================================


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: 
<mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--






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


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



<Prev in Thread] Current Thread [Next in Thread>