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

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   RE: [xml-dev] [newbie] Mapping a Map 101?

[ Lists Home | Date Index | Thread Index ]

> Out of curiosity, if <dict> was simply defined as an ordered sequence 
> of elements, where the even elements are the keys and the odd 
> elements 
> the values, how would the XQuery look like?
> 

Doing this without the sibling axis, I think you would have to do something
like


$elements[1 + 
  for $e at $pos in $elements
  where ($pos mod 2 = 1) and $e=$param
  return $pos]

Interestingly, the usual argument for not supporting the following-sibling
axis is that it's difficult to optimize - I wonder how good optimizers are
at handling the alternative?

Michael Kay
http://www.saxonica.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