[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Use of data() function (was: Re: [OT])

Subject: Use of data() function (was: Re: [OT])
From: "Mukul Gandhi" <gandhi.mukul@xxxxxxxxx>
Date: Fri, 29 Feb 2008 21:30:07 +0530
 Use of data() function (was: Re:  [OT])
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

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')"
xsl:if test="data(xs:string('yes'))"


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/

Mukul Gandhi

Current Thread


Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
First Name
Last Name
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.