XML/XQuery/last — различия между версиями
Admin (обсуждение | вклад) м (1 версия) |
|
(нет различий)
|
Текущая версия на 11:25, 26 мая 2010
Example of the last function
<source lang="xml">
File: Data.xml <orders>
<order name="B" xml:base="http://wbex.ru/ACC/"> <car id="0003" href="prod0003.html"/> <car id="0002" href="prod0002.html"/> </order> <order name="A" xml:base="http://wbex.ru/WMN/"> <car id="0001" href="prod0001.html"/> </order>
</orders> File: Query.xquery let $order := doc("Data.xml")/order for $prod in $order/car return concat($prod/id,
(if ($prod is $order/car[last()]) then (".") else (", "))) </source>