Re: [xsl] explain of Joerg xslt (was: xsl:copy ...)

Subject: Re: [xsl] explain of Joerg xslt (was: xsl:copy ...)
From: "Carsten Klein" <carstenklein@xxxxxxxx>
Date: Mon, 8 Apr 2002 15:58:11 +0200
Hi Mike,

thanks again =), but after I read through twice, yeah got lots of
time nowadays =9
I stumbled across

: No, this is completely wrong.
:
: <xsl:template match="..."> does not cause nodes to be processed.
: Only xsl:apply-templates and xsl:for-each do that.
:
: All you are doing when you provide a match template is saying that
*if* the
: processor *happens* to be processing a node that matches given
pattern, then
: this template *may* be applied.

Yes, this I was trying to say, that the <xsl:template match="...">
instructs the processor
to apply this template to all nodes which match this tag. Don't know
what is wrong with that.
Of course I could circumvent the default processing of that template
by using a mode attribute
on a <apply-templates/> or run through the nodes calling a named
template in a <xsl:for-each/> loop
instead of the default template I provided when writing the
stylesheet.

: <xsl:apply-templates/> is invoked. xsl:apply-templates with no
select means

Oh, well, I happen to know =), that the processors I used until now
(msxml, the one supplied
by Komodo 1.0 Win32) will only process the root node, therefore the
output document will only have
whatever is written down in the template matching the root node. All
other nodes and attributes of the
source tree are completely ignored. Perhaps another processor will
show up a different behaviour, but this
is beyond my knowledge for now. I'm starting to use Xalan-J, perhaps
this one will show a different behaviour.

: > xsl:call-template or xsl:apply-templates and xsl:for-each
:   ^^^^^^^^^^^^^^^^^
:
: It does not apply to xsl:call-template.

Ups, correct, yes.

: No. XPath/XSLT trees do not contain tags. Please learn to
differentiate
: between an abstract node tree and a serialized representation of
it.

Hm, a node does have a starting and ending tag, doesn't it? I mean,
this is what I learned when using html. Although
this description language does have a few nodes which don't
necessarily have a ending tag, e.g. <img> or <br>, <hr>.

But nonetheless the xml document description language uses the terms
start and end tag, or am I completely wrong?

When I wrote this I wanted to emphasize, that the node <tree> was
only introduced to the output document and that still
more information written to the output tree would follow, i.e. more
childnodes and attribute nodes and definetly a ending tag
to close the <tree> node.

All wrong? Completely? At least some truth in my words? Although not
that exhaustive an explanation as I could have been, I know, but you
know
time ...

: > this template now "calls" other templates which may match any
: > attribute node <xsl:apply-templates select="@*"/>.
:
: Not really. It tells the processor to go process all the attribute
nodes on
: the current node (the Indice element being processed). The best
matching
: template for each attribute is found and its contents
instantiated.

Well, in my own words, this would mean, that the processor is
instructed by the
@* select expression, to apply any templates which match any
attribute node, or as I wrote "call" templates which match an
arbritary
number and type of attribute nodes (except namespace nodes which are
handled differently, if I remember correctly).
Of course I could have done better, but my motto is to keep the
words as simple as possible whilst pushing the distraction to a max
=)

: I'm stopping here. :)

Yeah, you better had =) it gets even worse.




_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


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


Current Thread