xsl-list
[Top] [All Lists]

RE: [xsl] [OT]

2008-02-29 04:41:32
I am curious, what is the use of function, data() in XPath 
2.0; from stylesheet writer's perspective ?

As defined in the spec, data() function retrieves the typed 
value of the argument passed. The typed value (of say, a 
node) to me is more useful within the processor and not very 
much to the end user ...


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/


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