[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

Re: [xsl] XSL Dominos


Subject: Re: [xsl] XSL Dominos
From: David Carlisle <davidc@xxxxxxxxx>
Date: Fri, 28 May 2010 15:20:18 +0100

On 28/05/2010 15:09, Nick Leaton wrote:
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.


But as I say since it means you are not using the main control construct of the language, the program needs a lot more code (and is a lot less flexible, template application typically automaticaly recururses through element structure, whereas passing a message parameter you need to do it by hand 9and if the input isn't exactly as you expect it fails, as you've found)


On the problem I'm having, I have put in trace output, to push out $message at each stage.

value-of doesn't tell you what you need to know as it removes the structure


<foo><bar>hello</bar></foo> and "hello"  both have string value
"hello" but if they were in $message they would need very different paths.
<xsl:message select="$message"/>

would reveal more but still won't show you the difference between an element trade and a document node with element trade as child.

Try putting as="element(trade)" on xsl:param that you think should get trade elements (and similarly other xsl;param)


David




> 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

________________________________________________________________________ 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. ________________________________________________________________________



Current Thread
Keywords
xsl