relpipe-data/examples-in-xmltable-atom.xml
author František Kučera <franta-hg@frantovo.cz>
Mon, 21 Feb 2022 01:21:22 +0100
branchv_0
changeset 330 70e7eb578cfa
parent 263 8bf13358a50a
permissions -rw-r--r--
Added tag relpipe-v0.18 for changeset 5bc2bb8b7946
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
263
8bf13358a50a examples: relpipe-in-xmltable
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     1
<stránka
8bf13358a50a examples: relpipe-in-xmltable
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     2
	xmlns="https://trac.frantovo.cz/xml-web-generator/wiki/xmlns/strana"
8bf13358a50a examples: relpipe-in-xmltable
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     3
	xmlns:m="https://trac.frantovo.cz/xml-web-generator/wiki/xmlns/makro">
8bf13358a50a examples: relpipe-in-xmltable
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     4
	
8bf13358a50a examples: relpipe-in-xmltable
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     5
	<nadpis>Reading an Atom feed using XMLTable</nadpis>
8bf13358a50a examples: relpipe-in-xmltable
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     6
	<perex>converting arbitrary XML into relational data using XMLTable</perex>
8bf13358a50a examples: relpipe-in-xmltable
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     7
	<m:pořadí-příkladu>02800</m:pořadí-příkladu>
8bf13358a50a examples: relpipe-in-xmltable
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     8
8bf13358a50a examples: relpipe-in-xmltable
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     9
	<text xmlns="http://www.w3.org/1999/xhtml">
8bf13358a50a examples: relpipe-in-xmltable
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    10
		
8bf13358a50a examples: relpipe-in-xmltable
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    11
		<p>
8bf13358a50a examples: relpipe-in-xmltable
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    12
			In this exaple we will achieve the same result as in <m:a href="examples-xquery-atom">previous one with XQuery</m:a>
8bf13358a50a examples: relpipe-in-xmltable
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    13
			but we will use a different tool – <code>relpipe-in-xmltable</code>.
8bf13358a50a examples: relpipe-in-xmltable
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    14
			This approach differs from XQery one in several aspects:
8bf13358a50a examples: relpipe-in-xmltable
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    15
		</p>
8bf13358a50a examples: relpipe-in-xmltable
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    16
		
8bf13358a50a examples: relpipe-in-xmltable
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    17
		<ul>
8bf13358a50a examples: relpipe-in-xmltable
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    18
			<li>no need for writing a script/program – we need just to write an one-liner resp. call one command with parameters</li>
8bf13358a50a examples: relpipe-in-xmltable
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    19
			<li>no need for an external tool like Galax, BaseX or XQilla</li>
8bf13358a50a examples: relpipe-in-xmltable
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    20
			<li>no serialization to the intermediary XML and its immediate deserialization – the XML input is parsed in the same proces which outputs relational data</li>
8bf13358a50a examples: relpipe-in-xmltable
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    21
			<li>simpler (but less powerful) tool – we write only two or more XPath expressions</li>
8bf13358a50a examples: relpipe-in-xmltable
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    22
		</ul>
8bf13358a50a examples: relpipe-in-xmltable
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    23
		
8bf13358a50a examples: relpipe-in-xmltable
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    24
		<p>This is the (shortened) structure of our XML input:</p>
8bf13358a50a examples: relpipe-in-xmltable
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    25
8bf13358a50a examples: relpipe-in-xmltable
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    26
		<m:pre jazyk="xml" src="examples/atom-xmltable.xml"/>
8bf13358a50a examples: relpipe-in-xmltable
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    27
8bf13358a50a examples: relpipe-in-xmltable
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    28
		<p>This pipeline will download the XML data and transform it to two relations:</p>
8bf13358a50a examples: relpipe-in-xmltable
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    29
8bf13358a50a examples: relpipe-in-xmltable
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    30
		<m:pre jazyk="bash" src="examples/atom-xmltable.sh"/>
8bf13358a50a examples: relpipe-in-xmltable
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    31
		
8bf13358a50a examples: relpipe-in-xmltable
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    32
		<p>The first one contains individual entries and the second one contains the common header:</p>
8bf13358a50a examples: relpipe-in-xmltable
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    33
		
8bf13358a50a examples: relpipe-in-xmltable
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    34
		<m:pre jazyk="text" src="examples/atom-xmltable.txt"/>
8bf13358a50a examples: relpipe-in-xmltable
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    35
		
8bf13358a50a examples: relpipe-in-xmltable
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    36
		<p>
8bf13358a50a examples: relpipe-in-xmltable
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    37
			This example shows how to work with namespaces and how to generate multiple relations from a single XML input.
8bf13358a50a examples: relpipe-in-xmltable
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    38
			It also shows that the name of the relation do not have to be a literal but might be derived from the input document.
8bf13358a50a examples: relpipe-in-xmltable
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    39
		</p>
8bf13358a50a examples: relpipe-in-xmltable
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    40
		
8bf13358a50a examples: relpipe-in-xmltable
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    41
		<p>If we add the <code>id</code> attribute to the entries table, we can aggregate entries from various sources and still be able to JOIN them with their metadata.</p>
8bf13358a50a examples: relpipe-in-xmltable
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    42
		
8bf13358a50a examples: relpipe-in-xmltable
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    43
	</text>
8bf13358a50a examples: relpipe-in-xmltable
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    44
8bf13358a50a examples: relpipe-in-xmltable
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    45
</stránka>