relpipe-data/examples-in-xmltable-atom.xml
branchv_0
changeset 263 8bf13358a50a
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/relpipe-data/examples-in-xmltable-atom.xml	Thu Jul 25 22:16:12 2019 +0200
@@ -0,0 +1,45 @@
+<stránka
+	xmlns="https://trac.frantovo.cz/xml-web-generator/wiki/xmlns/strana"
+	xmlns:m="https://trac.frantovo.cz/xml-web-generator/wiki/xmlns/makro">
+	
+	<nadpis>Reading an Atom feed using XMLTable</nadpis>
+	<perex>converting arbitrary XML into relational data using XMLTable</perex>
+	<m:pořadí-příkladu>02800</m:pořadí-příkladu>
+
+	<text xmlns="http://www.w3.org/1999/xhtml">
+		
+		<p>
+			In this exaple we will achieve the same result as in <m:a href="examples-xquery-atom">previous one with XQuery</m:a>
+			but we will use a different tool – <code>relpipe-in-xmltable</code>.
+			This approach differs from XQery one in several aspects:
+		</p>
+		
+		<ul>
+			<li>no need for writing a script/program – we need just to write an one-liner resp. call one command with parameters</li>
+			<li>no need for an external tool like Galax, BaseX or XQilla</li>
+			<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>
+			<li>simpler (but less powerful) tool – we write only two or more XPath expressions</li>
+		</ul>
+		
+		<p>This is the (shortened) structure of our XML input:</p>
+
+		<m:pre jazyk="xml" src="examples/atom-xmltable.xml"/>
+
+		<p>This pipeline will download the XML data and transform it to two relations:</p>
+
+		<m:pre jazyk="bash" src="examples/atom-xmltable.sh"/>
+		
+		<p>The first one contains individual entries and the second one contains the common header:</p>
+		
+		<m:pre jazyk="text" src="examples/atom-xmltable.txt"/>
+		
+		<p>
+			This example shows how to work with namespaces and how to generate multiple relations from a single XML input.
+			It also shows that the name of the relation do not have to be a literal but might be derived from the input document.
+		</p>
+		
+		<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>
+		
+	</text>
+
+</stránka>