|
[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: RE: XQuery and DTD/Schema?
>
> > I can think of lots of scenarios where I would want my
> > get-total() function to
> > process the "merely well-formed elements whose name happens
> > to be 'invoice'".
> >
>
> I agree. I am both dissappointed and stunned that such functionality
> does not exist in XQuery.
>
Of course this functionality exists.
function getTotal (element* $nodes) {
return sum(for $x in $nodes[self::invoice] return
number($x//item/@price))
}
The fact that you are allowed to write specific types in function
signatures doesn't stop you writing generic ones if you prefer.
Michael Kay
Software AG
home: Michael.H.Kay@n...
work: Michael.Kay@s...
|
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
|
|||||||||

Cart








