xsl-list
[Top] [All Lists]

Re: [xsl] XSL Dominos

2010-05-28 09:09:56
In reverse order, on the fn: - good point, I'll remove them.

On the apply templates versus call, I've never been able to get my
head round the apply-templates bit, particular because of the need to
use a mode. I personally read apply-templates as, "something happens
here, but I don't know what" !!

Call templates makes it explicit as to what happens. My personal take
on that bit.

On the problem I'm having, I have put in trace output, to push out
$message at each stage. It is output correctly, however, the value-of
selections from $message/ give the value, or don't give the value
depending on whether or not its the compound xsl or the single stage
xsl

Nick

On Fri, May 28, 2010 at 3:03 PM, David Carlisle 
<davidc(_at_)nag(_dot_)co(_dot_)uk> wrote:
On 28/05/2010 14:49, Nick Leaton wrote:

Passing xml as parameters

I have a problem with passing xml fragments as parameters.


you'd probably find all the xsl a lot easier if you used apply-templates (in
a mode) rather than named templates everywhere to which you need to pass
input as a parameter, as essentially, you are implementing apply templates
by hand, but still...

cmf-html appears to be written to be called like this:




         <xsl:call-template name="cmf-html">
             <xsl:with-param name="message" select="trade"/>
         </xsl:call-template>

passed a trade element, but in your "domino" version it is being passed a
document node, perhaps that explains the difference?

Also note that you never need to declare

 xmlns:fn="http://www.w3.org/2005/xpath-functions";

as you can always refer to the built in functions unprefixed, count() rather
than fn:count().

David


________________________________________________________________________
The Numerical Algorithms Group Ltd is a company registered in England
and Wales with company number 1249803. The registered office is:
Wilkinson House, Jordan Hill Road, Oxford OX2 8DR, United Kingdom.

This e-mail has been scanned for all viruses by Star. The service is
powered by MessageLabs.
________________________________________________________________________




-- 
Nick

--~------------------------------------------------------------------
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>