Subject: [xsl] Use of data() function (was: Re: [xsl] [OT]) From: "Mukul Gandhi" <gandhi.mukul@xxxxxxxxx> Date: Fri, 29 Feb 2008 21:30:07 +0530 |
Hi Mike, Thanks for the explanation. Related to your points, I have few doubts and would be grateful, if you could explain this to me ... You wrote <xsl:if test="@married"> I think, this test will always return true. I used to read this as: test if this attribute on the context node(the element) exists. You say, we are testing the (effective) boolean value of the node (which sounds good to me ...) What exactly is meant by "effective boolean value" ? Is it the resultant boolean value of the expression after all structural normalizations? How should this be exactly interpreted: <xsl:if test="data(@married)"> Should I read this as: We are testing if the typed value of the node (the attribute node here) is true or false. Let's say, string value of @married attribute is 'yes' (and not the normal idioms of boolean, like true/1 or false/0), what does xsl:if test="data('yes')" or xsl:if test="data(xs:string('yes'))" do? Hope you could understand my confusion ... On Fri, Feb 29, 2008 at 5:11 PM, Michael Kay <mike@xxxxxxxxxxxx> wrote: > It's very rarely necessary to call data() explicitly, because atomization is > nearly always done automatically when needed. But there are occasions for > using it, especially with schema-aware processing. > > <xsl:if test="@married"> > > does not mean the same as > > <xsl:if test="data(@married)"> > > because the effective boolean value of a node is always true, regardless of > its typed value. > > Michael Kay > http://www.saxonica.com/ -- Regards, Mukul Gandhi
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[xsl] RE: Including some records an, Lewis, Russell | Thread | Re: [xsl] Use of data() function (w, Andrew Welch |
RE: [xsl] Insert elment in XSD, Michael Kay | Date | Re: [xsl] Slow XSLT, Cleyton Jordan |
Month |