[Home] [By Thread] [By Date] [Recent Entries]
Thank you for your as-always clear explanation Michael.
I work more and more with strong datatype in XSLT2, which make the code stronger, I'll do always declare a datatype pour stylesheet params.. and as I always use Saxon I know how it behaves now. Really usefull tip for boolean parameters ! After testing this, let me just add that the if the supply parameter cannot be casted to the declared type, saxon raise an error. I don't know how other xslt processors behaves in regard to this point, and sorry that my question is a bit "implementation dependant". Thank you for your response Ken, but as said Michael my question was about "always supplied parameters". But this make me think about another question : if no parameters is supplied, I'm use to test it againts empty string with <xsl:if test="$foo=''"/> and it usually works. Is an empty sequence equal to an emty string? (maybe the equal operator tries to cast both part to the same type ? Regards, Matthieu. Le 25/11/2011 01:06, Michael Kay a icrit : On 24/11/2011 23:31, G. Ken Holman wrote:At 2011-11-24 21:19 +0100, Matthieu Ricaud-Dussarget wrote:I think Ken is answering a different question - what is the default value of the parameter? If you don't supply a value, $foo will indeed be the empty sequence.When sending a parameter to the stylesheet( from command line with saxon for example), I thought it was always a string (which is a pitty when you need boolean parameter). -- Matthieu Ricaud IGS-CP Service Livre numirique
|

Cart



