[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Casting single-item sequences to atomic values
On 8 Apr 2014, at 14:42, Wendell Piez <wapiez@xxxxxxxxxxxxxxx> wrote: > Christian, > > This is easy to find in the spec ... if you look at the right spec. :-) > > http://www.w3.org/TR/xpath-datamodel/#sequences > > Cheers, Wendell > It might also be worth reminding people WHY a singleton and a sequence of length one are the same thing in XDM. Consider <book> <author>John</author> </book> Is child::author a single element, or a sequence of elements with length one? You can't tell without a schema. Treating both the same way is part of the "semi-structuredness" of XPath as an XML processing language. Contrast data binding tools, which rely on a schema to decide whether author is a single-valued or list-valued property, and cause your programs to break if the schema changes. Michael Kay Saxonica
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|