xsl-list
[Top] [All Lists]

Re: [xsl] [XSLT 2.0] Checking that an element's value has the desired datatype?

2006-10-16 10:09:59
On 10/16/06, Costello, Roger L. <costello(_at_)mitre(_dot_)org> wrote:
Excellent!  With this:

   matches(flt:Aircraft/flt:Altitude, '[0-9]+')

I can do datatype checking, without using XML Schemas.


This only determines that a value is castable to a subset of values of
the xs:integer type.

The real type of the value may be quite different, for example the xml
schema associated with this xml document may define it to be an
xs:string, and the fact that this instance just happens to be castable
to an xs:integer may be accidental.

We have the same in XSLT 1.0 -- for example an <xsl:sort/> instruction
will sort all sort key values as strings (regardless of the fact that
all they may be interpretable as numbers) unless explicitly directed
otherwise by specifying the attribute

        data-type="number".


--
Cheers,
Dimitre Novatchev
---------------------------------------
Truly great madness cannot be achieved without significant intelligence.
---------------------------------------
To invent, you need a good imagination and a pile of junk
-------------------------------------
You've achieved success in your field when you don't know whether what
you're doing is work or play

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