Subject: Re: [xsl] Q: to Jeni Tennison regarding your APress titles... From: "M. David Peterson" <m.david@xxxxxxxxxx> Date: Fri, 26 Nov 2004 13:19:52 -0800 |
Hi David,Hmmm... I'm not sure I understand. The way I interpreted what David Carlisle had stated was that, for example, if @bar had the value of "5" that you could use then use the number function to tell the XSLT processor to use the literal number value of @bar to determine the position of an element in relation to the document order of an element in relation to its siblings. Is that how it is or did I misinterpret what David was saying?
You mean "foo[number(@bar)]" (which selects the <foo> element children
of the current node whose bar attributes match their position amongst
other <foo> elements within the current node) or, more feasibly,
"foo[number(current()/@bar)]" (which selects the nth <foo> element
child of the current node where n is the value of the bar attribute of
the current node).
Ah yes, very good advice. In fact I have found that the only time I even use named templates anymore is for recursively seeking out particular content within a string and processing it further or as a way to specify the number of times the named template should be called and the instruction set processed before moving forward. And even then I try to make minimal use of this type of processing for the simple fact that if used in the wrong situation you can find yourself spending a lot of CPU cycles and bottleneck an entire application because of it.
Right -- that's part of why I tend to advise people to use matching
templates with modes rather than named templates: with a matching
template, you have some hope of knowing what the context node is by
looking at the pattern, with a named template you can't tell without
finding the call to that template, which makes debugging that much
harder.
That would be great! I know that we would all appreciate any further insight you have on particular topics. We are going to use Dr. Kay's XSLT and XPath (1.0 and 2.0) Programmer References as a way of further referencing a topic. But to have your insight to further understand a topic of interest would be invaluable and an outstanding asset to the project.
I'll certainly try to pop in.
Great, I will leave it as is then.
No; a link to Amazon is fine.
Cheers,
Jeni
--- Jeni Tennison http://www.jenitennison.com/
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] Q: to Jeni Tennison regar, Jeni Tennison | Thread | [xsl] understanding key usage, Osman Çınar Eren |
Re: [xsl] Convert copyright symbol , M. David Peterson | Date | Re: [xsl] How to test FXSL for XSLT, Dimtre Novatchev |
Month |