relpipe-data/examples/atom.xq
author František Kučera <franta-hg@frantovo.cz>
Mon, 21 Feb 2022 01:21:22 +0100
branchv_0
changeset 330 70e7eb578cfa
parent 232 c7d05cf04b76
permissions -rw-r--r--
Added tag relpipe-v0.18 for changeset 5bc2bb8b7946

xquery version "1.0";

declare namespace relpipe="tag:globalcode.info,2018:relpipe";
declare namespace atom="http://www.w3.org/2005/Atom";

<relpipe xmlns="tag:globalcode.info,2018:relpipe">
	<relation>
		<name>atom</name>
		<attributes-metadata>
			<attribute-metadata name="published" type="string"/>
			<attribute-metadata name="title" type="string"/>
			<attribute-metadata name="url" type="string"/>
		</attributes-metadata>

		{
			for $e in /atom:feed/atom:entry
			order by $e/atom:published descending
			return
				<record>
					<attribute>{$e/atom:published/text()}</attribute>
					<attribute>{$e/atom:title/text()}</attribute>
					<attribute>{string($e/atom:link/@href)}</attribute>
				</record>
		}
	</relation>
</relpipe>