OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   RE: RE: [xml-dev] XQuery and DTD/Schema?

[ Lists Home | Date Index | Thread Index ]

> 
> > 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@ntlworld.com
work: Michael.Kay@softwareag.com 





 

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS