summaryrefslogtreecommitdiffstats
path: root/test/xml
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-15 05:48:59 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-15 05:48:59 +0000
commitc484829272cd13a738e35412498e12f2c9a194ac (patch)
treea1f5ec09629ee895bd3963fa8820b45f2f4c574b /test/xml
parentInitial commit. (diff)
downloadliborcus-upstream.tar.xz
liborcus-upstream.zip
Adding upstream version 0.19.2.upstream/0.19.2upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r--test/xml-mapped/attribute-basic/check-nomap.txt30
-rw-r--r--test/xml-mapped/attribute-basic/check.txt34
-rw-r--r--test/xml-mapped/attribute-basic/input.xml14
-rw-r--r--test/xml-mapped/attribute-basic/map.xml16
-rw-r--r--test/xml-mapped/attribute-namespace-2/check-nomap.txt12
-rw-r--r--test/xml-mapped/attribute-namespace-2/check.txt12
-rw-r--r--test/xml-mapped/attribute-namespace-2/input.xml8
-rw-r--r--test/xml-mapped/attribute-namespace-2/map.xml12
-rw-r--r--test/xml-mapped/attribute-namespace/check-nomap.txt12
-rw-r--r--test/xml-mapped/attribute-namespace/check.txt12
-rw-r--r--test/xml-mapped/attribute-namespace/input.xml8
-rw-r--r--test/xml-mapped/attribute-namespace/map.xml12
-rw-r--r--test/xml-mapped/attribute-range-self-close/check-nomap.txt24
-rw-r--r--test/xml-mapped/attribute-range-self-close/check.txt24
-rw-r--r--test/xml-mapped/attribute-range-self-close/input.xml8
-rw-r--r--test/xml-mapped/attribute-range-self-close/map.xml11
-rw-r--r--test/xml-mapped/attribute-single-element-2/check.txt2
-rw-r--r--test/xml-mapped/attribute-single-element-2/input.xml2
-rw-r--r--test/xml-mapped/attribute-single-element-2/map.xml6
-rw-r--r--test/xml-mapped/attribute-single-element/check.txt2
-rw-r--r--test/xml-mapped/attribute-single-element/input.xml2
-rw-r--r--test/xml-mapped/attribute-single-element/map.xml6
-rw-r--r--test/xml-mapped/content-basic/check-nomap.txt24
-rw-r--r--test/xml-mapped/content-basic/check.txt27
-rw-r--r--test/xml-mapped/content-basic/input.xml27
-rw-r--r--test/xml-mapped/content-basic/map.xml14
-rw-r--r--test/xml-mapped/content-namespace-2/check-nomap.txt12
-rw-r--r--test/xml-mapped/content-namespace-2/check.txt12
-rw-r--r--test/xml-mapped/content-namespace-2/input.xml22
-rw-r--r--test/xml-mapped/content-namespace-2/map.xml13
-rw-r--r--test/xml-mapped/content-namespace-3/check-nomap.txt12
-rw-r--r--test/xml-mapped/content-namespace-3/check.txt13
-rw-r--r--test/xml-mapped/content-namespace-3/input.xml26
-rw-r--r--test/xml-mapped/content-namespace-3/map.xml12
-rw-r--r--test/xml-mapped/content-namespace/check-nomap.txt12
-rw-r--r--test/xml-mapped/content-namespace/check.txt13
-rw-r--r--test/xml-mapped/content-namespace/input.xml26
-rw-r--r--test/xml-mapped/content-namespace/map.xml12
-rw-r--r--test/xml-mapped/content-one-column/check-nomap.txt4
-rw-r--r--test/xml-mapped/content-one-column/input.xml6
-rw-r--r--test/xml-mapped/custom-labels-2/check.txt12
-rw-r--r--test/xml-mapped/custom-labels-2/input.xml8
-rw-r--r--test/xml-mapped/custom-labels-2/map.xml12
-rw-r--r--test/xml-mapped/custom-labels/check.txt27
-rw-r--r--test/xml-mapped/custom-labels/input.xml27
-rw-r--r--test/xml-mapped/custom-labels/map.xml14
-rw-r--r--test/xml-mapped/encoding/euc-jp.xml12
-rw-r--r--test/xml-mapped/encoding/gbk.xml139
-rw-r--r--test/xml-mapped/encoding/utf-8.xml27
-rw-r--r--test/xml-mapped/fuel-economy/check-nomap.txt3
-rw-r--r--test/xml-mapped/fuel-economy/check.txt4
-rw-r--r--test/xml-mapped/fuel-economy/input.xml11
-rw-r--r--test/xml-mapped/fuel-economy/map.xml9
-rw-r--r--test/xml-mapped/invalids/map-defs/non-leaf-element-linked.xml9
-rw-r--r--test/xml-mapped/invalids/map-defs/not-xml.xml1
-rw-r--r--test/xml-mapped/nested-repeats-2/check-nomap.txt31
-rw-r--r--test/xml-mapped/nested-repeats-2/check.txt31
-rw-r--r--test/xml-mapped/nested-repeats-2/input.xml21
-rw-r--r--test/xml-mapped/nested-repeats-2/map.xml12
-rw-r--r--test/xml-mapped/nested-repeats-3/check-nomap.txt44
-rw-r--r--test/xml-mapped/nested-repeats-3/check.txt44
-rw-r--r--test/xml-mapped/nested-repeats-3/input.xml32
-rw-r--r--test/xml-mapped/nested-repeats-3/map.xml13
-rw-r--r--test/xml-mapped/nested-repeats-4/check-nomap.txt44
-rw-r--r--test/xml-mapped/nested-repeats-4/check.txt44
-rw-r--r--test/xml-mapped/nested-repeats-4/input.xml38
-rw-r--r--test/xml-mapped/nested-repeats-4/map.xml13
-rw-r--r--test/xml-mapped/nested-repeats/check-nomap.txt20
-rw-r--r--test/xml-mapped/nested-repeats/check.txt20
-rw-r--r--test/xml-mapped/nested-repeats/input.xml18
-rw-r--r--test/xml-mapped/nested-repeats/map.xml10
-rw-r--r--test/xml-structure/attribute-1/check.txt7
-rw-r--r--test/xml-structure/attribute-1/input.xml5
-rw-r--r--test/xml-structure/basic-1/check.txt5
-rw-r--r--test/xml-structure/basic-1/input.xml13
-rw-r--r--test/xml-structure/basic-2/check.txt5
-rw-r--r--test/xml-structure/basic-2/input.xml7
-rw-r--r--test/xml-structure/basic-3/check.txt9
-rw-r--r--test/xml-structure/basic-3/input.xml19
-rw-r--r--test/xml-structure/namespace-default/check.txt5
-rw-r--r--test/xml-structure/namespace-default/input.xml6
-rw-r--r--test/xml-structure/nested-repeat-1/check.txt12
-rw-r--r--test/xml-structure/nested-repeat-1/input.xml20
-rw-r--r--test/xml/bom/check.txt11
-rw-r--r--test/xml/bom/input.xml1
-rw-r--r--test/xml/cdata-1/check.txt18
-rw-r--r--test/xml/cdata-1/input.xml10
-rw-r--r--test/xml/custom-decl-1/check.txt99
-rw-r--r--test/xml/custom-decl-1/input.xml3
-rw-r--r--test/xml/default-ns/check.txt17
-rw-r--r--test/xml/default-ns/input.xml12
-rw-r--r--test/xml/doctype/html.xml6
-rw-r--r--test/xml/encoded-attrs/test1.xml5
-rw-r--r--test/xml/encoded-char/check.txt19
-rw-r--r--test/xml/encoded-char/input.xml11
-rw-r--r--test/xml/invalids/double-boms-and-invalid-byte.xml1
-rw-r--r--test/xml/invalids/only-bom.xml1
-rw-r--r--test/xml/invalids/only-double-boms.xml1
-rw-r--r--test/xml/invalids/partial-attr-value-with-encoding-char.xml2
-rw-r--r--test/xml/invalids/partial-open-element.xml2
-rw-r--r--test/xml/no-decl-1/check.txt8
-rw-r--r--test/xml/no-decl-1/input.xml8
-rw-r--r--test/xml/ns-alias-1/check.txt10
-rw-r--r--test/xml/ns-alias-1/input.xml6
-rw-r--r--test/xml/osm/street-in-aizu.osm227
-rw-r--r--test/xml/parse-only/rss/input.xml67
-rw-r--r--test/xml/self-closing-root/check.txt1
-rw-r--r--test/xml/self-closing-root/input.xml1
-rw-r--r--test/xml/simple/check.txt12
-rw-r--r--test/xml/simple/input.xml13
-rw-r--r--test/xml/single-quote/check.txt11
-rw-r--r--test/xml/single-quote/input.xml9
-rw-r--r--test/xml/underscore-identifier/check.txt5
-rw-r--r--test/xml/underscore-identifier/input.xml4
-rw-r--r--test/xml/utf8-1/check.txt4
-rw-r--r--test/xml/utf8-1/input.xml4
-rw-r--r--test/xml/utf8-2/check.txt4
-rw-r--r--test/xml/utf8-2/input.xml5
-rw-r--r--test/xml/valids/double-boms.xml1
119 files changed, 2038 insertions, 0 deletions
diff --git a/test/xml-mapped/attribute-basic/check-nomap.txt b/test/xml-mapped/attribute-basic/check-nomap.txt
new file mode 100644
index 0000000..d1bb6ef
--- /dev/null
+++ b/test/xml-mapped/attribute-basic/check-nomap.txt
@@ -0,0 +1,30 @@
+range-0/0/0:string:"id"
+range-0/0/1:string:"first-name"
+range-0/0/2:string:"last-name"
+range-0/0/3:string:"score"
+range-0/0/4:string:"entry"
+range-0/1/0:numeric:1
+range-0/1/1:string:"Bill"
+range-0/1/2:string:"Clinton"
+range-0/1/3:numeric:456
+range-0/1/4:string:"in"
+range-0/2/0:numeric:2
+range-0/2/1:string:"David"
+range-0/2/2:string:"Cameron"
+range-0/2/3:numeric:323
+range-0/2/4:string:"out"
+range-0/3/0:numeric:3
+range-0/3/1:string:"Barak"
+range-0/3/2:string:"Obama"
+range-0/3/3:numeric:234
+range-0/3/4:string:"unknown"
+range-0/4/0:numeric:4
+range-0/4/1:string:"Yoshihiko"
+range-0/4/2:string:"Noda"
+range-0/4/3:numeric:192
+range-0/4/4:string:"in"
+range-0/5/0:numeric:5
+range-0/5/1:string:"Angela"
+range-0/5/2:string:"Merkel"
+range-0/5/3:numeric:210
+range-0/5/4:string:"ask later"
diff --git a/test/xml-mapped/attribute-basic/check.txt b/test/xml-mapped/attribute-basic/check.txt
new file mode 100644
index 0000000..31fc805
--- /dev/null
+++ b/test/xml-mapped/attribute-basic/check.txt
@@ -0,0 +1,34 @@
+data/0/0:string:"TOP SECRET"
+data/0/2:numeric:1.1
+data/1/0:string:"Simple Data File"
+data/1/2:string:"2012-08-12"
+data/3/0:string:"id"
+data/3/1:string:"first-name"
+data/3/2:string:"last-name"
+data/3/3:string:"score"
+data/3/4:string:"entry"
+data/4/0:numeric:1
+data/4/1:string:"Bill"
+data/4/2:string:"Clinton"
+data/4/3:numeric:456
+data/4/4:string:"in"
+data/5/0:numeric:2
+data/5/1:string:"David"
+data/5/2:string:"Cameron"
+data/5/3:numeric:323
+data/5/4:string:"out"
+data/6/0:numeric:3
+data/6/1:string:"Barak"
+data/6/2:string:"Obama"
+data/6/3:numeric:234
+data/6/4:string:"unknown"
+data/7/0:numeric:4
+data/7/1:string:"Yoshihiko"
+data/7/2:string:"Noda"
+data/7/3:numeric:192
+data/7/4:string:"in"
+data/8/0:numeric:5
+data/8/1:string:"Angela"
+data/8/2:string:"Merkel"
+data/8/3:numeric:210
+data/8/4:string:"ask later"
diff --git a/test/xml-mapped/attribute-basic/input.xml b/test/xml-mapped/attribute-basic/input.xml
new file mode 100644
index 0000000..f19bc3f
--- /dev/null
+++ b/test/xml-mapped/attribute-basic/input.xml
@@ -0,0 +1,14 @@
+<?xml version="1.0"?>
+<data version="1.1">
+ <header label="TOP SECRET">Simple Data File</header>
+ <entries>
+ <entry id="1" first-name="Bill" last-name="Clinton" score="456">in</entry>
+ <entry id="2" first-name="David" last-name="Cameron" score="323">out</entry>
+ <entry id="3" first-name="Barak" last-name="Obama" score="234">unknown</entry>
+ <entry id="4" first-name="Yoshihiko" last-name="Noda" score="192">in</entry>
+ <entry id="5" first-name="Angela" last-name="Merkel" score="210">ask later</entry>
+ </entries>
+ <footer date="2012-08-12">
+ <extra>Not for distribution</extra>
+ </footer>
+</data>
diff --git a/test/xml-mapped/attribute-basic/map.xml b/test/xml-mapped/attribute-basic/map.xml
new file mode 100644
index 0000000..97172f2
--- /dev/null
+++ b/test/xml-mapped/attribute-basic/map.xml
@@ -0,0 +1,16 @@
+<?xml version="1.0"?>
+<map xmlns="http://gitorious.org/orcus/xml-map">
+ <sheet name="data"/>
+ <cell path="/data/header/@label" row="0" column="0" sheet="data"/>
+ <cell path="/data/header" row="1" column="0" sheet="data"/>
+ <cell path="/data/footer/@date" row="1" column="2" sheet="data"/>
+ <cell path="/data/@version" row="0" column="2" sheet="data"/>
+ <range row="3" column="0" sheet="data">
+ <field path="/data/entries/entry/@id"/>
+ <field path="/data/entries/entry/@first-name"/>
+ <field path="/data/entries/entry/@last-name"/>
+ <field path="/data/entries/entry/@score"/>
+ <field path="/data/entries/entry"/>
+ <row-group path="/data/entries/entry"/>
+ </range>
+</map>
diff --git a/test/xml-mapped/attribute-namespace-2/check-nomap.txt b/test/xml-mapped/attribute-namespace-2/check-nomap.txt
new file mode 100644
index 0000000..63fe3cc
--- /dev/null
+++ b/test/xml-mapped/attribute-namespace-2/check-nomap.txt
@@ -0,0 +1,12 @@
+range-0/0/0:string:"ns1:date-received"
+range-0/0/1:string:"ns1:date-processed"
+range-0/0/2:string:"ns1:received-by"
+range-0/1/0:string:"2011-01-01"
+range-0/1/1:string:"2011-01-03"
+range-0/1/2:string:"JKB"
+range-0/2/0:string:"2011-01-01"
+range-0/2/1:string:"2011-01-04"
+range-0/2/2:string:"CJ"
+range-0/3/0:string:"2011-12-23"
+range-0/3/1:string:"2012-01-01"
+range-0/3/2:string:"KY"
diff --git a/test/xml-mapped/attribute-namespace-2/check.txt b/test/xml-mapped/attribute-namespace-2/check.txt
new file mode 100644
index 0000000..c8f23a3
--- /dev/null
+++ b/test/xml-mapped/attribute-namespace-2/check.txt
@@ -0,0 +1,12 @@
+data/1/1:string:"ns1:date-received"
+data/1/2:string:"ns1:date-processed"
+data/1/3:string:"ns1:received-by"
+data/2/1:string:"2011-01-01"
+data/2/2:string:"2011-01-03"
+data/2/3:string:"JKB"
+data/3/1:string:"2011-01-01"
+data/3/2:string:"2011-01-04"
+data/3/3:string:"CJ"
+data/4/1:string:"2011-12-23"
+data/4/2:string:"2012-01-01"
+data/4/3:string:"KY"
diff --git a/test/xml-mapped/attribute-namespace-2/input.xml b/test/xml-mapped/attribute-namespace-2/input.xml
new file mode 100644
index 0000000..4a29806
--- /dev/null
+++ b/test/xml-mapped/attribute-namespace-2/input.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0"?>
+<a:data xmlns:a="http://ns-1" xmlns:b="http://ns-2">
+ <b:entries>
+ <b:entry b:date-received="2011-01-01" b:date-processed="2011-01-03" b:received-by="JKB"/>
+ <b:entry b:date-received="2011-01-01" b:date-processed="2011-01-04" b:received-by="CJ"/>
+ <b:entry b:date-received="2011-12-23" b:date-processed="2012-01-01" b:received-by="KY"/>
+ </b:entries>
+</a:data>
diff --git a/test/xml-mapped/attribute-namespace-2/map.xml b/test/xml-mapped/attribute-namespace-2/map.xml
new file mode 100644
index 0000000..4a51c85
--- /dev/null
+++ b/test/xml-mapped/attribute-namespace-2/map.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0"?>
+<map xmlns="http://gitorious.org/orcus/xml-map">
+ <ns alias="x" uri="http://ns-1"/>
+ <ns alias="y" uri="http://ns-2" default="true"/>
+ <sheet name="data"/>
+ <range row="1" column="1" sheet="data">
+ <field path="/x:data/entries/entry/@date-received"/>
+ <field path="/x:data/entries/entry/@date-processed"/>
+ <field path="/x:data/entries/entry/@received-by"/>
+ <row-group path="/x:data/entries/entry"/>
+ </range>
+</map>
diff --git a/test/xml-mapped/attribute-namespace/check-nomap.txt b/test/xml-mapped/attribute-namespace/check-nomap.txt
new file mode 100644
index 0000000..63fe3cc
--- /dev/null
+++ b/test/xml-mapped/attribute-namespace/check-nomap.txt
@@ -0,0 +1,12 @@
+range-0/0/0:string:"ns1:date-received"
+range-0/0/1:string:"ns1:date-processed"
+range-0/0/2:string:"ns1:received-by"
+range-0/1/0:string:"2011-01-01"
+range-0/1/1:string:"2011-01-03"
+range-0/1/2:string:"JKB"
+range-0/2/0:string:"2011-01-01"
+range-0/2/1:string:"2011-01-04"
+range-0/2/2:string:"CJ"
+range-0/3/0:string:"2011-12-23"
+range-0/3/1:string:"2012-01-01"
+range-0/3/2:string:"KY"
diff --git a/test/xml-mapped/attribute-namespace/check.txt b/test/xml-mapped/attribute-namespace/check.txt
new file mode 100644
index 0000000..c8f23a3
--- /dev/null
+++ b/test/xml-mapped/attribute-namespace/check.txt
@@ -0,0 +1,12 @@
+data/1/1:string:"ns1:date-received"
+data/1/2:string:"ns1:date-processed"
+data/1/3:string:"ns1:received-by"
+data/2/1:string:"2011-01-01"
+data/2/2:string:"2011-01-03"
+data/2/3:string:"JKB"
+data/3/1:string:"2011-01-01"
+data/3/2:string:"2011-01-04"
+data/3/3:string:"CJ"
+data/4/1:string:"2011-12-23"
+data/4/2:string:"2012-01-01"
+data/4/3:string:"KY"
diff --git a/test/xml-mapped/attribute-namespace/input.xml b/test/xml-mapped/attribute-namespace/input.xml
new file mode 100644
index 0000000..4a29806
--- /dev/null
+++ b/test/xml-mapped/attribute-namespace/input.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0"?>
+<a:data xmlns:a="http://ns-1" xmlns:b="http://ns-2">
+ <b:entries>
+ <b:entry b:date-received="2011-01-01" b:date-processed="2011-01-03" b:received-by="JKB"/>
+ <b:entry b:date-received="2011-01-01" b:date-processed="2011-01-04" b:received-by="CJ"/>
+ <b:entry b:date-received="2011-12-23" b:date-processed="2012-01-01" b:received-by="KY"/>
+ </b:entries>
+</a:data>
diff --git a/test/xml-mapped/attribute-namespace/map.xml b/test/xml-mapped/attribute-namespace/map.xml
new file mode 100644
index 0000000..76e5b72
--- /dev/null
+++ b/test/xml-mapped/attribute-namespace/map.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0"?>
+<map xmlns="http://gitorious.org/orcus/xml-map">
+ <ns alias="x" uri="http://ns-1"/>
+ <ns alias="y" uri="http://ns-2"/>
+ <sheet name="data"/>
+ <range row="1" column="1" sheet="data">
+ <field path="/x:data/y:entries/y:entry/@y:date-received"/>
+ <field path="/x:data/y:entries/y:entry/@y:date-processed"/>
+ <field path="/x:data/y:entries/y:entry/@y:received-by"/>
+ <row-group path="/x:data/y:entries/y:entry"/>
+ </range>
+</map>
diff --git a/test/xml-mapped/attribute-range-self-close/check-nomap.txt b/test/xml-mapped/attribute-range-self-close/check-nomap.txt
new file mode 100644
index 0000000..4c5a8d5
--- /dev/null
+++ b/test/xml-mapped/attribute-range-self-close/check-nomap.txt
@@ -0,0 +1,24 @@
+range-0/0/0:string:"id"
+range-0/0/1:string:"first-name"
+range-0/0/2:string:"last-name"
+range-0/0/3:string:"score"
+range-0/1/0:numeric:1
+range-0/1/1:string:"Bill"
+range-0/1/2:string:"Clinton"
+range-0/1/3:numeric:456
+range-0/2/0:numeric:2
+range-0/2/1:string:"David"
+range-0/2/2:string:"Cameron"
+range-0/2/3:numeric:323
+range-0/3/0:numeric:3
+range-0/3/1:string:"Barak"
+range-0/3/2:string:"Obama"
+range-0/3/3:numeric:234
+range-0/4/0:numeric:4
+range-0/4/1:string:"Yoshihiko"
+range-0/4/2:string:"Noda"
+range-0/4/3:numeric:192
+range-0/5/0:numeric:5
+range-0/5/1:string:"Angela"
+range-0/5/2:string:"Merkel"
+range-0/5/3:numeric:210
diff --git a/test/xml-mapped/attribute-range-self-close/check.txt b/test/xml-mapped/attribute-range-self-close/check.txt
new file mode 100644
index 0000000..5a049c0
--- /dev/null
+++ b/test/xml-mapped/attribute-range-self-close/check.txt
@@ -0,0 +1,24 @@
+data/3/0:string:"id"
+data/3/1:string:"first-name"
+data/3/2:string:"last-name"
+data/3/3:string:"score"
+data/4/0:numeric:1
+data/4/1:string:"Bill"
+data/4/2:string:"Clinton"
+data/4/3:numeric:456
+data/5/0:numeric:2
+data/5/1:string:"David"
+data/5/2:string:"Cameron"
+data/5/3:numeric:323
+data/6/0:numeric:3
+data/6/1:string:"Barak"
+data/6/2:string:"Obama"
+data/6/3:numeric:234
+data/7/0:numeric:4
+data/7/1:string:"Yoshihiko"
+data/7/2:string:"Noda"
+data/7/3:numeric:192
+data/8/0:numeric:5
+data/8/1:string:"Angela"
+data/8/2:string:"Merkel"
+data/8/3:numeric:210
diff --git a/test/xml-mapped/attribute-range-self-close/input.xml b/test/xml-mapped/attribute-range-self-close/input.xml
new file mode 100644
index 0000000..6e9e31d
--- /dev/null
+++ b/test/xml-mapped/attribute-range-self-close/input.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0"?>
+<data>
+ <entry id="1" first-name="Bill" last-name="Clinton" score="456"/>
+ <entry id="2" first-name="David" last-name="Cameron" score="323"/>
+ <entry id="3" first-name="Barak" last-name="Obama" score="234"/>
+ <entry id="4" first-name="Yoshihiko" last-name="Noda" score="192"/>
+ <entry id="5" first-name="Angela" last-name="Merkel" score="210"/>
+</data>
diff --git a/test/xml-mapped/attribute-range-self-close/map.xml b/test/xml-mapped/attribute-range-self-close/map.xml
new file mode 100644
index 0000000..4e03133
--- /dev/null
+++ b/test/xml-mapped/attribute-range-self-close/map.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0"?>
+<map xmlns="http://gitorious.org/orcus/xml-map">
+ <sheet name="data"/>
+ <range row="3" column="0" sheet="data">
+ <field path="/data/entry/@id"/>
+ <field path="/data/entry/@first-name"/>
+ <field path="/data/entry/@last-name"/>
+ <field path="/data/entry/@score"/>
+ <row-group path="/data/entry"/>
+ </range>
+</map>
diff --git a/test/xml-mapped/attribute-single-element-2/check.txt b/test/xml-mapped/attribute-single-element-2/check.txt
new file mode 100644
index 0000000..8a0ff58
--- /dev/null
+++ b/test/xml-mapped/attribute-single-element-2/check.txt
@@ -0,0 +1,2 @@
+data/2/3:numeric:1.1
+data/2/4:string:"2012-09-30"
diff --git a/test/xml-mapped/attribute-single-element-2/input.xml b/test/xml-mapped/attribute-single-element-2/input.xml
new file mode 100644
index 0000000..82dffee
--- /dev/null
+++ b/test/xml-mapped/attribute-single-element-2/input.xml
@@ -0,0 +1,2 @@
+<?xml version="1.0"?>
+<root-only version="1.1" date="2012-09-30">This is not linked</root-only>
diff --git a/test/xml-mapped/attribute-single-element-2/map.xml b/test/xml-mapped/attribute-single-element-2/map.xml
new file mode 100644
index 0000000..0ba42ff
--- /dev/null
+++ b/test/xml-mapped/attribute-single-element-2/map.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0"?>
+<map xmlns="http://gitorious.org/orcus/xml-map">
+ <sheet name="data"/>
+ <cell path="/root-only/@version" row="2" column="3" sheet="data"/>
+ <cell path="/root-only/@date" row="2" column="4" sheet="data"/>
+</map>
diff --git a/test/xml-mapped/attribute-single-element/check.txt b/test/xml-mapped/attribute-single-element/check.txt
new file mode 100644
index 0000000..8a0ff58
--- /dev/null
+++ b/test/xml-mapped/attribute-single-element/check.txt
@@ -0,0 +1,2 @@
+data/2/3:numeric:1.1
+data/2/4:string:"2012-09-30"
diff --git a/test/xml-mapped/attribute-single-element/input.xml b/test/xml-mapped/attribute-single-element/input.xml
new file mode 100644
index 0000000..dd24486
--- /dev/null
+++ b/test/xml-mapped/attribute-single-element/input.xml
@@ -0,0 +1,2 @@
+<?xml version="1.0"?>
+<root-only version="1.1" date="2012-09-30"/>
diff --git a/test/xml-mapped/attribute-single-element/map.xml b/test/xml-mapped/attribute-single-element/map.xml
new file mode 100644
index 0000000..0ba42ff
--- /dev/null
+++ b/test/xml-mapped/attribute-single-element/map.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0"?>
+<map xmlns="http://gitorious.org/orcus/xml-map">
+ <sheet name="data"/>
+ <cell path="/root-only/@version" row="2" column="3" sheet="data"/>
+ <cell path="/root-only/@date" row="2" column="4" sheet="data"/>
+</map>
diff --git a/test/xml-mapped/content-basic/check-nomap.txt b/test/xml-mapped/content-basic/check-nomap.txt
new file mode 100644
index 0000000..b0ec4d7
--- /dev/null
+++ b/test/xml-mapped/content-basic/check-nomap.txt
@@ -0,0 +1,24 @@
+range-0/0/0:string:"id"
+range-0/0/1:string:"first"
+range-0/0/2:string:"last"
+range-0/0/3:string:"score"
+range-0/1/0:numeric:1
+range-0/1/1:string:"Bill"
+range-0/1/2:string:"Clinton"
+range-0/1/3:numeric:456
+range-0/2/0:numeric:2
+range-0/2/1:string:"David"
+range-0/2/2:string:"Cameron"
+range-0/2/3:numeric:323
+range-0/3/0:numeric:3
+range-0/3/1:string:"Barak"
+range-0/3/2:string:"Obama"
+range-0/3/3:numeric:234
+range-0/4/0:numeric:4
+range-0/4/1:string:"Yoshihiko"
+range-0/4/2:string:"Noda"
+range-0/4/3:numeric:192
+range-0/5/0:numeric:5
+range-0/5/1:string:"Angela"
+range-0/5/2:string:"Merkel"
+range-0/5/3:numeric:210
diff --git a/test/xml-mapped/content-basic/check.txt b/test/xml-mapped/content-basic/check.txt
new file mode 100644
index 0000000..ef90e22
--- /dev/null
+++ b/test/xml-mapped/content-basic/check.txt
@@ -0,0 +1,27 @@
+data/0/0:string:"TOP SECRET"
+data/1/0:string:"Simple Data File"
+data/1/2:string:"2012-08-12"
+data/3/0:string:"id"
+data/3/1:string:"first"
+data/3/2:string:"last"
+data/3/3:string:"score"
+data/4/0:numeric:1
+data/4/1:string:"Bill"
+data/4/2:string:"Clinton"
+data/4/3:numeric:456
+data/5/0:numeric:2
+data/5/1:string:"David"
+data/5/2:string:"Cameron"
+data/5/3:numeric:323
+data/6/0:numeric:3
+data/6/1:string:"Barak"
+data/6/2:string:"Obama"
+data/6/3:numeric:234
+data/7/0:numeric:4
+data/7/1:string:"Yoshihiko"
+data/7/2:string:"Noda"
+data/7/3:numeric:192
+data/8/0:numeric:5
+data/8/1:string:"Angela"
+data/8/2:string:"Merkel"
+data/8/3:numeric:210
diff --git a/test/xml-mapped/content-basic/input.xml b/test/xml-mapped/content-basic/input.xml
new file mode 100644
index 0000000..f6d4abc
--- /dev/null
+++ b/test/xml-mapped/content-basic/input.xml
@@ -0,0 +1,27 @@
+<?xml version="1.0"?>
+<data>
+ <label>TOP SECRET</label>
+ <header>
+ <title>Simple Data File</title>
+ </header>
+ <entries>
+ <entry>
+ <id>1</id><name><first>Bill</first><last>Clinton</last></name><score>456</score>
+ </entry>
+ <entry>
+ <id>2</id><name><first>David</first><last>Cameron</last></name><score>323</score>
+ </entry>
+ <entry>
+ <id>3</id><name><first>Barak</first><last>Obama</last></name><score>234</score>
+ </entry>
+ <entry>
+ <id>4</id><name><first>Yoshihiko</first><last>Noda</last></name><score>192</score>
+ </entry>
+ <entry>
+ <id>5</id><name><first>Angela</first><last>Merkel</last></name><score>210</score>
+ </entry>
+ </entries>
+ <footer>
+ <date>2012-08-12</date>
+ </footer>
+</data>
diff --git a/test/xml-mapped/content-basic/map.xml b/test/xml-mapped/content-basic/map.xml
new file mode 100644
index 0000000..248daa7
--- /dev/null
+++ b/test/xml-mapped/content-basic/map.xml
@@ -0,0 +1,14 @@
+<?xml version="1.0"?>
+<map xmlns="http://gitorious.org/orcus/xml-map">
+ <sheet name="data"/>
+ <cell path="/data/label" row="0" column="0" sheet="data"/>
+ <cell path="/data/header/title" row="1" column="0" sheet="data"/>
+ <cell path="/data/footer/date" row="1" column="2" sheet="data"/>
+ <range row="3" column="0" sheet="data">
+ <field path="/data/entries/entry/id"/>
+ <field path="/data/entries/entry/name/first"/>
+ <field path="/data/entries/entry/name/last"/>
+ <field path="/data/entries/entry/score"/>
+ <row-group path="/data/entries/entry"/>
+ </range>
+</map>
diff --git a/test/xml-mapped/content-namespace-2/check-nomap.txt b/test/xml-mapped/content-namespace-2/check-nomap.txt
new file mode 100644
index 0000000..d7c6de8
--- /dev/null
+++ b/test/xml-mapped/content-namespace-2/check-nomap.txt
@@ -0,0 +1,12 @@
+range-0/0/0:string:"ns2:date"
+range-0/0/1:string:"ns2:category"
+range-0/0/2:string:"ns2:amount"
+range-0/1/0:string:"2011-01-02"
+range-0/1/1:string:"Lunch"
+range-0/1/2:numeric:6.32
+range-0/2/0:string:"2011-01-03"
+range-0/2/1:string:"Lunch"
+range-0/2/2:numeric:7.45
+range-0/3/0:string:"2011-01-04"
+range-0/3/1:string:"Gas"
+range-0/3/2:numeric:44.35
diff --git a/test/xml-mapped/content-namespace-2/check.txt b/test/xml-mapped/content-namespace-2/check.txt
new file mode 100644
index 0000000..a4c7237
--- /dev/null
+++ b/test/xml-mapped/content-namespace-2/check.txt
@@ -0,0 +1,12 @@
+data/2/0:string:"ns2:date"
+data/2/1:string:"ns2:category"
+data/2/2:string:"ns2:amount"
+data/3/0:string:"2011-01-02"
+data/3/1:string:"Lunch"
+data/3/2:numeric:6.32
+data/4/0:string:"2011-01-03"
+data/4/1:string:"Lunch"
+data/4/2:numeric:7.45
+data/5/0:string:"2011-01-04"
+data/5/1:string:"Gas"
+data/5/2:numeric:44.35
diff --git a/test/xml-mapped/content-namespace-2/input.xml b/test/xml-mapped/content-namespace-2/input.xml
new file mode 100644
index 0000000..435dfce
--- /dev/null
+++ b/test/xml-mapped/content-namespace-2/input.xml
@@ -0,0 +1,22 @@
+<?xml version="1.0"?>
+<a:data xmlns:a="http://namespace-1">
+ <b:monthly xmlns:b="http://namespace-2" xmlns:c="http://namespace-3">
+ <b:entries>
+ <b:entry>
+ <c:date>2011-01-02</c:date>
+ <c:category>Lunch</c:category>
+ <c:amount>6.32</c:amount>
+ </b:entry>
+ <b:entry>
+ <c:date>2011-01-03</c:date>
+ <c:category>Lunch</c:category>
+ <c:amount>7.45</c:amount>
+ </b:entry>
+ <b:entry>
+ <c:date>2011-01-04</c:date>
+ <c:category>Gas</c:category>
+ <c:amount>44.35</c:amount>
+ </b:entry>
+ </b:entries>
+ </b:monthly>
+</a:data>
diff --git a/test/xml-mapped/content-namespace-2/map.xml b/test/xml-mapped/content-namespace-2/map.xml
new file mode 100644
index 0000000..172de50
--- /dev/null
+++ b/test/xml-mapped/content-namespace-2/map.xml
@@ -0,0 +1,13 @@
+<?xml version="1.0"?>
+<map xmlns="http://gitorious.org/orcus/xml-map">
+ <ns alias="x" uri="http://namespace-1"/>
+ <ns alias="y" uri="http://namespace-2"/>
+ <ns alias="z" uri="http://namespace-3"/>
+ <sheet name="data"/>
+ <range row="2" column="0" sheet="data">
+ <field path="/x:data/y:monthly/y:entries/y:entry/z:date"/>
+ <field path="/x:data/y:monthly/y:entries/y:entry/z:category"/>
+ <field path="/x:data/y:monthly/y:entries/y:entry/z:amount"/>
+ <row-group path="/x:data/y:monthly/y:entries/y:entry"/>
+ </range>
+</map>
diff --git a/test/xml-mapped/content-namespace-3/check-nomap.txt b/test/xml-mapped/content-namespace-3/check-nomap.txt
new file mode 100644
index 0000000..dce2781
--- /dev/null
+++ b/test/xml-mapped/content-namespace-3/check-nomap.txt
@@ -0,0 +1,12 @@
+range-0/0/0:string:"ns0:city"
+range-0/0/1:string:"ns0:population"
+range-0/0/2:string:"ns0:year"
+range-0/1/0:string:"Tokyo"
+range-0/1/1:numeric:13189000
+range-0/1/2:numeric:2011
+range-0/2/0:string:"New York City"
+range-0/2/1:numeric:8244910
+range-0/2/2:numeric:2011
+range-0/3/0:string:"London"
+range-0/3/1:numeric:8174100
+range-0/3/2:numeric:2011
diff --git a/test/xml-mapped/content-namespace-3/check.txt b/test/xml-mapped/content-namespace-3/check.txt
new file mode 100644
index 0000000..98d2013
--- /dev/null
+++ b/test/xml-mapped/content-namespace-3/check.txt
@@ -0,0 +1,13 @@
+data/0/0:string:"Sample data"
+data/2/0:string:"ns0:city"
+data/2/1:string:"ns0:population"
+data/2/2:string:"ns0:year"
+data/3/0:string:"Tokyo"
+data/3/1:numeric:13189000
+data/3/2:numeric:2011
+data/4/0:string:"New York City"
+data/4/1:numeric:8244910
+data/4/2:numeric:2011
+data/5/0:string:"London"
+data/5/1:numeric:8174100
+data/5/2:numeric:2011
diff --git a/test/xml-mapped/content-namespace-3/input.xml b/test/xml-mapped/content-namespace-3/input.xml
new file mode 100644
index 0000000..6e3c8b8
--- /dev/null
+++ b/test/xml-mapped/content-namespace-3/input.xml
@@ -0,0 +1,26 @@
+<?xml version="1.0"?>
+<b:table xmlns:b="http://some-namespace" xmlns:skip="http://namespace-to-skip">
+ <b:title>Sample data</b:title>
+ <b:rows>
+ <b:row>
+ <b:city>Tokyo</b:city>
+ <b:population>13189000</b:population>
+ <b:year>2011</b:year>
+ </b:row>
+ <b:row>
+ <b:city>New York City</b:city>
+ <b:population>8244910</b:population>
+ <b:year>2011</b:year>
+ </b:row>
+ <b:row>
+ <b:city>London</b:city>
+ <b:population>8174100</b:population>
+ <b:year>2011</b:year>
+ </b:row>
+ <skip:row>
+ <b:city>Beijing</b:city>
+ <b:population>20180000</b:population>
+ <b:year>2011</b:year>
+ </skip:row>
+ </b:rows>
+</b:table>
diff --git a/test/xml-mapped/content-namespace-3/map.xml b/test/xml-mapped/content-namespace-3/map.xml
new file mode 100644
index 0000000..419bf0c
--- /dev/null
+++ b/test/xml-mapped/content-namespace-3/map.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0"?>
+<map xmlns="http://gitorious.org/orcus/xml-map">
+ <ns alias="a" uri="http://some-namespace" default="true"/>
+ <sheet name="data"/>
+ <cell path="/a:table/title" row="0" column="0" sheet="data"/>
+ <range row="2" column="0" sheet="data">
+ <field path="/a:table/rows/a:row/city"/>
+ <field path="/a:table/rows/a:row/population"/>
+ <field path="/a:table/rows/a:row/year"/>
+ <row-group path="/table/rows/row"/>
+ </range>
+</map>
diff --git a/test/xml-mapped/content-namespace/check-nomap.txt b/test/xml-mapped/content-namespace/check-nomap.txt
new file mode 100644
index 0000000..dce2781
--- /dev/null
+++ b/test/xml-mapped/content-namespace/check-nomap.txt
@@ -0,0 +1,12 @@
+range-0/0/0:string:"ns0:city"
+range-0/0/1:string:"ns0:population"
+range-0/0/2:string:"ns0:year"
+range-0/1/0:string:"Tokyo"
+range-0/1/1:numeric:13189000
+range-0/1/2:numeric:2011
+range-0/2/0:string:"New York City"
+range-0/2/1:numeric:8244910
+range-0/2/2:numeric:2011
+range-0/3/0:string:"London"
+range-0/3/1:numeric:8174100
+range-0/3/2:numeric:2011
diff --git a/test/xml-mapped/content-namespace/check.txt b/test/xml-mapped/content-namespace/check.txt
new file mode 100644
index 0000000..98d2013
--- /dev/null
+++ b/test/xml-mapped/content-namespace/check.txt
@@ -0,0 +1,13 @@
+data/0/0:string:"Sample data"
+data/2/0:string:"ns0:city"
+data/2/1:string:"ns0:population"
+data/2/2:string:"ns0:year"
+data/3/0:string:"Tokyo"
+data/3/1:numeric:13189000
+data/3/2:numeric:2011
+data/4/0:string:"New York City"
+data/4/1:numeric:8244910
+data/4/2:numeric:2011
+data/5/0:string:"London"
+data/5/1:numeric:8174100
+data/5/2:numeric:2011
diff --git a/test/xml-mapped/content-namespace/input.xml b/test/xml-mapped/content-namespace/input.xml
new file mode 100644
index 0000000..6e3c8b8
--- /dev/null
+++ b/test/xml-mapped/content-namespace/input.xml
@@ -0,0 +1,26 @@
+<?xml version="1.0"?>
+<b:table xmlns:b="http://some-namespace" xmlns:skip="http://namespace-to-skip">
+ <b:title>Sample data</b:title>
+ <b:rows>
+ <b:row>
+ <b:city>Tokyo</b:city>
+ <b:population>13189000</b:population>
+ <b:year>2011</b:year>
+ </b:row>
+ <b:row>
+ <b:city>New York City</b:city>
+ <b:population>8244910</b:population>
+ <b:year>2011</b:year>
+ </b:row>
+ <b:row>
+ <b:city>London</b:city>
+ <b:population>8174100</b:population>
+ <b:year>2011</b:year>
+ </b:row>
+ <skip:row>
+ <b:city>Beijing</b:city>
+ <b:population>20180000</b:population>
+ <b:year>2011</b:year>
+ </skip:row>
+ </b:rows>
+</b:table>
diff --git a/test/xml-mapped/content-namespace/map.xml b/test/xml-mapped/content-namespace/map.xml
new file mode 100644
index 0000000..9cd4bed
--- /dev/null
+++ b/test/xml-mapped/content-namespace/map.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0"?>
+<map xmlns="http://gitorious.org/orcus/xml-map">
+ <ns alias="a" uri="http://some-namespace"/>
+ <sheet name="data"/>
+ <cell path="/a:table/a:title" row="0" column="0" sheet="data"/>
+ <range row="2" column="0" sheet="data">
+ <field path="/a:table/a:rows/a:row/a:city"/>
+ <field path="/a:table/a:rows/a:row/a:population"/>
+ <field path="/a:table/a:rows/a:row/a:year"/>
+ <row-group path="/a:table/a:rows/a:row"/>
+ </range>
+</map>
diff --git a/test/xml-mapped/content-one-column/check-nomap.txt b/test/xml-mapped/content-one-column/check-nomap.txt
new file mode 100644
index 0000000..8d43e1f
--- /dev/null
+++ b/test/xml-mapped/content-one-column/check-nomap.txt
@@ -0,0 +1,4 @@
+range-0/0/0:string:"data"
+range-0/1/0:string:"v1"
+range-0/2/0:string:"v2"
+range-0/3/0:string:"v3"
diff --git a/test/xml-mapped/content-one-column/input.xml b/test/xml-mapped/content-one-column/input.xml
new file mode 100644
index 0000000..e43b477
--- /dev/null
+++ b/test/xml-mapped/content-one-column/input.xml
@@ -0,0 +1,6 @@
+<?xml encoding="utf-8"?>
+<root>
+ <data>v1</data>
+ <data>v2</data>
+ <data>v3</data>
+</root>
diff --git a/test/xml-mapped/custom-labels-2/check.txt b/test/xml-mapped/custom-labels-2/check.txt
new file mode 100644
index 0000000..829dc2e
--- /dev/null
+++ b/test/xml-mapped/custom-labels-2/check.txt
@@ -0,0 +1,12 @@
+data/1/1:string:"Date Received"
+data/1/2:string:"Date Processed"
+data/1/3:string:"Received by"
+data/2/1:string:"2011-01-01"
+data/2/2:string:"2011-01-03"
+data/2/3:string:"JKB"
+data/3/1:string:"2011-01-01"
+data/3/2:string:"2011-01-04"
+data/3/3:string:"CJ"
+data/4/1:string:"2011-12-23"
+data/4/2:string:"2012-01-01"
+data/4/3:string:"KY"
diff --git a/test/xml-mapped/custom-labels-2/input.xml b/test/xml-mapped/custom-labels-2/input.xml
new file mode 100644
index 0000000..4a29806
--- /dev/null
+++ b/test/xml-mapped/custom-labels-2/input.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0"?>
+<a:data xmlns:a="http://ns-1" xmlns:b="http://ns-2">
+ <b:entries>
+ <b:entry b:date-received="2011-01-01" b:date-processed="2011-01-03" b:received-by="JKB"/>
+ <b:entry b:date-received="2011-01-01" b:date-processed="2011-01-04" b:received-by="CJ"/>
+ <b:entry b:date-received="2011-12-23" b:date-processed="2012-01-01" b:received-by="KY"/>
+ </b:entries>
+</a:data>
diff --git a/test/xml-mapped/custom-labels-2/map.xml b/test/xml-mapped/custom-labels-2/map.xml
new file mode 100644
index 0000000..3dcdf47
--- /dev/null
+++ b/test/xml-mapped/custom-labels-2/map.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0"?>
+<map xmlns="http://gitorious.org/orcus/xml-map">
+ <ns alias="x" uri="http://ns-1"/>
+ <ns alias="y" uri="http://ns-2" default="true"/>
+ <sheet name="data"/>
+ <range row="1" column="1" sheet="data">
+ <field path="/x:data/entries/entry/@date-received" label="Date Received"/>
+ <field path="/x:data/entries/entry/@date-processed" label="Date Processed"/>
+ <field path="/x:data/entries/entry/@received-by" label="Received by"/>
+ <row-group path="/x:data/entries/entry"/>
+ </range>
+</map>
diff --git a/test/xml-mapped/custom-labels/check.txt b/test/xml-mapped/custom-labels/check.txt
new file mode 100644
index 0000000..d1ebce5
--- /dev/null
+++ b/test/xml-mapped/custom-labels/check.txt
@@ -0,0 +1,27 @@
+data/0/0:string:"TOP SECRET"
+data/1/0:string:"Simple Data File"
+data/1/2:string:"2012-08-12"
+data/3/0:string:"ID"
+data/3/1:string:"First Name"
+data/3/2:string:"Last Name"
+data/3/3:string:"Test Score"
+data/4/0:numeric:1
+data/4/1:string:"Bill"
+data/4/2:string:"Clinton"
+data/4/3:numeric:456
+data/5/0:numeric:2
+data/5/1:string:"David"
+data/5/2:string:"Cameron"
+data/5/3:numeric:323
+data/6/0:numeric:3
+data/6/1:string:"Barak"
+data/6/2:string:"Obama"
+data/6/3:numeric:234
+data/7/0:numeric:4
+data/7/1:string:"Yoshihiko"
+data/7/2:string:"Noda"
+data/7/3:numeric:192
+data/8/0:numeric:5
+data/8/1:string:"Angela"
+data/8/2:string:"Merkel"
+data/8/3:numeric:210
diff --git a/test/xml-mapped/custom-labels/input.xml b/test/xml-mapped/custom-labels/input.xml
new file mode 100644
index 0000000..f6d4abc
--- /dev/null
+++ b/test/xml-mapped/custom-labels/input.xml
@@ -0,0 +1,27 @@
+<?xml version="1.0"?>
+<data>
+ <label>TOP SECRET</label>
+ <header>
+ <title>Simple Data File</title>
+ </header>
+ <entries>
+ <entry>
+ <id>1</id><name><first>Bill</first><last>Clinton</last></name><score>456</score>
+ </entry>
+ <entry>
+ <id>2</id><name><first>David</first><last>Cameron</last></name><score>323</score>
+ </entry>
+ <entry>
+ <id>3</id><name><first>Barak</first><last>Obama</last></name><score>234</score>
+ </entry>
+ <entry>
+ <id>4</id><name><first>Yoshihiko</first><last>Noda</last></name><score>192</score>
+ </entry>
+ <entry>
+ <id>5</id><name><first>Angela</first><last>Merkel</last></name><score>210</score>
+ </entry>
+ </entries>
+ <footer>
+ <date>2012-08-12</date>
+ </footer>
+</data>
diff --git a/test/xml-mapped/custom-labels/map.xml b/test/xml-mapped/custom-labels/map.xml
new file mode 100644
index 0000000..0a7b64e
--- /dev/null
+++ b/test/xml-mapped/custom-labels/map.xml
@@ -0,0 +1,14 @@
+<?xml version="1.0"?>
+<map xmlns="https://gitlab.com/orcus/orcus">
+ <sheet name="data"/>
+ <cell path="/data/label" row="0" column="0" sheet="data"/>
+ <cell path="/data/header/title" row="1" column="0" sheet="data"/>
+ <cell path="/data/footer/date" row="1" column="2" sheet="data"/>
+ <range row="3" column="0" sheet="data">
+ <field path="/data/entries/entry/id" label="ID"/>
+ <field path="/data/entries/entry/name/first" label="First Name"/>
+ <field path="/data/entries/entry/name/last" label="Last Name"/>
+ <field path="/data/entries/entry/score" label="Test Score"/>
+ <row-group path="/data/entries/entry"/>
+ </range>
+</map>
diff --git a/test/xml-mapped/encoding/euc-jp.xml b/test/xml-mapped/encoding/euc-jp.xml
new file mode 100644
index 0000000..30f963b
--- /dev/null
+++ b/test/xml-mapped/encoding/euc-jp.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="EUC-JP"?>
+<root>
+ <entry>ܸ죱</entry>
+ <entry>ܸ죲</entry>
+ <entry>ܸ죳</entry>
+ <entry>ܸ죴</entry>
+ <entry>ܸ죵</entry>
+ <entry>ܸ죶</entry>
+ <entry>ܸ죷</entry>
+ <entry>ܸ죸</entry>
+ <entry>ܸ죹</entry>
+</root>
diff --git a/test/xml-mapped/encoding/gbk.xml b/test/xml-mapped/encoding/gbk.xml
new file mode 100644
index 0000000..92d45e7
--- /dev/null
+++ b/test/xml-mapped/encoding/gbk.xml
@@ -0,0 +1,139 @@
+<?xml version="1.0" encoding="GBK"?>
+<Kp>
+ <Version>2.0</Version>
+ <Fpxx>
+ <Zsl>43</Zsl>
+ <Fpsj>
+ <Fp>
+ <Djh/>
+ <Fpzl>ר÷Ʊ</Fpzl>
+ <Lbdm>210***3130</Lbdm>
+ <Fphm>01***724</Fphm>
+ <Kprq>202***02</Kprq>
+ <Gfmc>Ϻ***ҵ޹˾</Gfmc>
+ <Gfsh>913101***95811677F</Gfsh>
+ <Gfyhzh>Ϻ·֧31001546***050004961</Gfyhzh>
+ <Gfdzdh>Ϻв·1***A10 021-62***662</Gfdzdh>
+ <Xfmc>******޹˾</Xfmc>
+ <Xfsh>9121***826612142928</Xfsh>
+ <Xfyhzh>йũҵ***֧ 50590***0003583</Xfyhzh>
+ <Xfdzdh>*** 8922857</Xfdzdh>
+ <Hjje>94847.03</Hjje>
+ <Hjse>8536.23</Hjse>
+ <Bz/>
+ <Kpr>*</Kpr>
+ <Fhr>*Ӣ</Fhr>
+ <Skr>*Ө</Skr>
+ <Spbmbbh>39.0</Spbmbbh>
+ <Hsbz>0</Hsbz>
+ <Spxx>
+ <Sph>
+ <Xh>1</Xh>
+ <Spmc>*****</Spmc>
+ <Ggxh/>
+ <Jldw>kg</Jldw>
+ <Spbm>1030107010100000000</Spbm>
+ <Qyspbm>00005</Qyspbm>
+ <Syyhzcbz>0</Syyhzcbz>
+ <Lslbz/>
+ <Yhzcsm/>
+ <Dj>11.743119266055046</Dj>
+ <Sl>169.2</Sl>
+ <Je>1986.94</Je>
+ <Slv>0.09</Slv>
+ <Se>178.82</Se>
+ </Sph>
+ <Sph>
+ <Xh>2</Xh>
+ <Spmc>*****</Spmc>
+ <Ggxh/>
+ <Jldw>kg</Jldw>
+ <Spbm>1030107010100000000</Spbm>
+ <Qyspbm>00005</Qyspbm>
+ <Syyhzcbz>0</Syyhzcbz>
+ <Lslbz/>
+ <Yhzcsm/>
+ <Dj>11.467889908256881</Dj>
+ <Sl>385.4</Sl>
+ <Je>4419.72</Je>
+ <Slv>0.09</Slv>
+ <Se>397.78</Se>
+ </Sph>
+ <Sph>
+ <Xh>3</Xh>
+ <Spmc>*****</Spmc>
+ <Ggxh/>
+ <Jldw>kg</Jldw>
+ <Spbm>1030107010100000000</Spbm>
+ <Qyspbm>00021</Qyspbm>
+ <Syyhzcbz>0</Syyhzcbz>
+ <Lslbz/>
+ <Yhzcsm/>
+ <Dj>10.550458715596330</Dj>
+ <Sl>500</Sl>
+ <Je>5275.23</Je>
+ <Slv>0.09</Slv>
+ <Se>474.77</Se>
+ </Sph>
+ <Sph>
+ <Xh>4</Xh>
+ <Spmc>*****</Spmc>
+ <Ggxh/>
+ <Jldw>kg</Jldw>
+ <Spbm>1030107010100000000</Spbm>
+ <Qyspbm>00015</Qyspbm>
+ <Syyhzcbz>0</Syyhzcbz>
+ <Lslbz/>
+ <Yhzcsm/>
+ <Dj>33.944954128440367</Dj>
+ <Sl>2450</Sl>
+ <Je>83165.14</Je>
+ <Slv>0.09</Slv>
+ <Se>7484.86</Se>
+ </Sph>
+ </Spxx>
+ </Fp>
+ <Fp>
+ <Djh/>
+ <Fpzl>ͨƱ</Fpzl>
+ <Lbdm>0210***00404</Lbdm>
+ <Fphm>47***608</Fphm>
+ <Kprq>20***802</Kprq>
+ <Gfmc>Ϻ***ʳƷ޹˾</Gfmc>
+ <Gfsh>9131011***1334373K</Gfsh>
+ <Gfyhzh>Ϻɽ·֧ 10012469***06906246</Gfyhzh>
+ <Gfdzdh>Ϻͨ·4***Ū418¥ 52***0300</Gfdzdh>
+ <Xfmc>***޹˾</Xfmc>
+ <Xfsh>91210******12142928</Xfsh>
+ <Xfyhzh>йũҵ***֧ 50590***0003583</Xfyhzh>
+ <Xfdzdh>*** 8922857</Xfdzdh>
+ <Hjje>87590.64</Hjje>
+ <Hjse>7883.16</Hjse>
+ <Bz/>
+ <Kpr>*</Kpr>
+ <Fhr>*Ӣ</Fhr>
+ <Skr>*Ө</Skr>
+ <Spbmbbh>39.0</Spbmbbh>
+ <Hsbz>0</Hsbz>
+ <Spxx>
+ <Sph>
+ <Xh>1</Xh>
+ <Spmc>****</Spmc>
+ <Ggxh/>
+ <Jldw>kg</Jldw>
+ <Spbm>1030107010100000000</Spbm>
+ <Qyspbm>00002</Qyspbm>
+ <Syyhzcbz>0</Syyhzcbz>
+ <Lslbz/>
+ <Yhzcsm/>
+ <Dj>10.642201834862385</Dj>
+ <Sl>8230.5</Sl>
+ <Je>87590.64</Je>
+ <Slv>0.09</Slv>
+ <Se>7883.16</Se>
+ </Sph>
+ </Spxx>
+ </Fp>
+ </Fpsj>
+ </Fpxx>
+</Kp> \ No newline at end of file
diff --git a/test/xml-mapped/encoding/utf-8.xml b/test/xml-mapped/encoding/utf-8.xml
new file mode 100644
index 0000000..09d902a
--- /dev/null
+++ b/test/xml-mapped/encoding/utf-8.xml
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="utf-8"?>
+<data>
+ <label>TOP SECRET</label>
+ <header>
+ <title>Simple Data File</title>
+ </header>
+ <entries>
+ <entry>
+ <id>1</id><name><first>Bill</first><last>Clinton</last></name><score>456</score>
+ </entry>
+ <entry>
+ <id>2</id><name><first>David</first><last>Cameron</last></name><score>323</score>
+ </entry>
+ <entry>
+ <id>3</id><name><first>Barak</first><last>Obama</last></name><score>234</score>
+ </entry>
+ <entry>
+ <id>4</id><name><first>Yoshihiko</first><last>Noda</last></name><score>192</score>
+ </entry>
+ <entry>
+ <id>5</id><name><first>Angela</first><last>Merkel</last></name><score>210</score>
+ </entry>
+ </entries>
+ <footer>
+ <date>2012-08-12</date>
+ </footer>
+</data>
diff --git a/test/xml-mapped/fuel-economy/check-nomap.txt b/test/xml-mapped/fuel-economy/check-nomap.txt
new file mode 100644
index 0000000..ae3e59a
--- /dev/null
+++ b/test/xml-mapped/fuel-economy/check-nomap.txt
@@ -0,0 +1,3 @@
+range-0/0/0:string:"barrels08"
+range-0/1/0:numeric:15
+range-0/2/0:numeric:29
diff --git a/test/xml-mapped/fuel-economy/check.txt b/test/xml-mapped/fuel-economy/check.txt
new file mode 100644
index 0000000..76224a9
--- /dev/null
+++ b/test/xml-mapped/fuel-economy/check.txt
@@ -0,0 +1,4 @@
+data/0/0:string:"atvType"
+data/0/1:string:"barrels08"
+data/1/1:numeric:15
+data/2/1:numeric:29
diff --git a/test/xml-mapped/fuel-economy/input.xml b/test/xml-mapped/fuel-economy/input.xml
new file mode 100644
index 0000000..dc043fe
--- /dev/null
+++ b/test/xml-mapped/fuel-economy/input.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<vehicles>
+ <vehicle>
+ <atvType/>
+ <barrels08>15</barrels08>
+ </vehicle>
+ <vehicle>
+ <atvType/>
+ <barrels08>29</barrels08>
+ </vehicle>
+</vehicles>
diff --git a/test/xml-mapped/fuel-economy/map.xml b/test/xml-mapped/fuel-economy/map.xml
new file mode 100644
index 0000000..fc20890
--- /dev/null
+++ b/test/xml-mapped/fuel-economy/map.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0"?>
+<map xmlns="http://gitorious.org/orcus/xml-map">
+ <sheet name="data"/>
+ <range row="0" column="0" sheet="data">
+ <field path="/vehicles/vehicle/atvType"/>
+ <field path="/vehicles/vehicle/barrels08"/>
+ <row-group path="/vehicles/vehicle"/>
+ </range>
+</map>
diff --git a/test/xml-mapped/invalids/map-defs/non-leaf-element-linked.xml b/test/xml-mapped/invalids/map-defs/non-leaf-element-linked.xml
new file mode 100644
index 0000000..de94368
--- /dev/null
+++ b/test/xml-mapped/invalids/map-defs/non-leaf-element-linked.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0"?>
+<map xmlns="http://gitorious.org/orcus/xml-map">
+ <sheet name="data"/>
+ <range row="3" column="0" sheet="data">
+ <field path="/data/entries/entry/name"/>
+ <field path="/data/entries/entry/name/first"/>
+ <row-group path="/data/entries/entry"/>
+ </range>
+</map>
diff --git a/test/xml-mapped/invalids/map-defs/not-xml.xml b/test/xml-mapped/invalids/map-defs/not-xml.xml
new file mode 100644
index 0000000..dce8dbc
--- /dev/null
+++ b/test/xml-mapped/invalids/map-defs/not-xml.xml
@@ -0,0 +1 @@
+asdfdasf
diff --git a/test/xml-mapped/nested-repeats-2/check-nomap.txt b/test/xml-mapped/nested-repeats-2/check-nomap.txt
new file mode 100644
index 0000000..029c983
--- /dev/null
+++ b/test/xml-mapped/nested-repeats-2/check-nomap.txt
@@ -0,0 +1,31 @@
+range-0/0/0:string:"name"
+range-0/0/1:string:"id"
+range-0/0/2:string:"ref"
+range-0/1/0:string:"foo"
+range-0/1/1:string:"A"
+range-0/1/2:numeric:123456789
+range-0/2/0:string:"foo"
+range-0/2/1:string:"A"
+range-0/2/2:numeric:987654321
+range-0/3/0:string:"foo"
+range-0/3/1:string:"B"
+range-0/3/2:numeric:1
+range-0/4/0:string:"foo"
+range-0/4/1:string:"B"
+range-0/4/2:numeric:2
+range-0/5/0:string:"foo"
+range-0/5/1:string:"B"
+range-0/5/2:numeric:3
+range-0/6/0:string:"foo"
+range-0/6/1:string:"C"
+range-0/6/2:numeric:1.1
+range-0/7/0:string:"foo"
+range-0/7/1:string:"C"
+range-0/7/2:numeric:2.2
+range-0/8/0:string:"foo"
+range-0/8/1:string:"C"
+range-0/8/2:numeric:3.3
+range-0/9/0:string:"foo"
+range-0/9/1:string:"C"
+range-0/9/2:numeric:4.4
+range-0/10/0:string:"bah"
diff --git a/test/xml-mapped/nested-repeats-2/check.txt b/test/xml-mapped/nested-repeats-2/check.txt
new file mode 100644
index 0000000..adbe04a
--- /dev/null
+++ b/test/xml-mapped/nested-repeats-2/check.txt
@@ -0,0 +1,31 @@
+data/0/0:string:"name"
+data/0/1:string:"id"
+data/0/2:string:"ref"
+data/1/0:string:"foo"
+data/1/1:string:"A"
+data/1/2:numeric:123456789
+data/2/0:string:"foo"
+data/2/1:string:"A"
+data/2/2:numeric:987654321
+data/3/0:string:"foo"
+data/3/1:string:"B"
+data/3/2:numeric:1
+data/4/0:string:"foo"
+data/4/1:string:"B"
+data/4/2:numeric:2
+data/5/0:string:"foo"
+data/5/1:string:"B"
+data/5/2:numeric:3
+data/6/0:string:"foo"
+data/6/1:string:"C"
+data/6/2:numeric:1.1
+data/7/0:string:"foo"
+data/7/1:string:"C"
+data/7/2:numeric:2.2
+data/8/0:string:"foo"
+data/8/1:string:"C"
+data/8/2:numeric:3.3
+data/9/0:string:"foo"
+data/9/1:string:"C"
+data/9/2:numeric:4.4
+data/10/0:string:"bah"
diff --git a/test/xml-mapped/nested-repeats-2/input.xml b/test/xml-mapped/nested-repeats-2/input.xml
new file mode 100644
index 0000000..325dc82
--- /dev/null
+++ b/test/xml-mapped/nested-repeats-2/input.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<osm version="0.6">
+ <parent name="foo">
+ <way id="A">
+ <nd ref="123456789"/>
+ <nd ref="987654321"/>
+ </way>
+ <way id="B">
+ <nd ref="1"/>
+ <nd ref="2"/>
+ <nd ref="3"/>
+ </way>
+ <way id="C">
+ <nd ref="1.1"/>
+ <nd ref="2.2"/>
+ <nd ref="3.3"/>
+ <nd ref="4.4"/>
+ </way>
+ </parent>
+ <parent name="bah"/>
+</osm>
diff --git a/test/xml-mapped/nested-repeats-2/map.xml b/test/xml-mapped/nested-repeats-2/map.xml
new file mode 100644
index 0000000..3a03807
--- /dev/null
+++ b/test/xml-mapped/nested-repeats-2/map.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0"?>
+<map xmlns="http://gitorious.org/orcus/xml-map">
+ <sheet name="data"/>
+ <range row="0" column="0" sheet="data">
+ <field path="/osm/parent/@name"/>
+ <field path="/osm/parent/way/@id"/>
+ <field path="/osm/parent/way/nd/@ref"/>
+ <row-group path="/osm/parent"/>
+ <row-group path="/osm/parent/way"/>
+ <row-group path="/osm/parent/way/nd"/>
+ </range>
+</map>
diff --git a/test/xml-mapped/nested-repeats-3/check-nomap.txt b/test/xml-mapped/nested-repeats-3/check-nomap.txt
new file mode 100644
index 0000000..e7e0703
--- /dev/null
+++ b/test/xml-mapped/nested-repeats-3/check-nomap.txt
@@ -0,0 +1,44 @@
+range-0/0/0:string:"id"
+range-0/0/1:string:"first_name"
+range-0/0/2:string:"last_name"
+range-0/0/3:string:"gender"
+range-0/0/4:string:"score"
+range-0/1/0:numeric:1
+range-0/1/1:string:"Mace"
+range-0/1/2:string:"Stainton"
+range-0/1/3:string:"Male"
+range-0/1/4:numeric:39
+range-0/2/0:numeric:1
+range-0/2/1:string:"Mace"
+range-0/2/2:string:"Stainton"
+range-0/2/3:string:"Male"
+range-0/2/4:numeric:42
+range-0/3/0:numeric:1
+range-0/3/1:string:"Mace"
+range-0/3/2:string:"Stainton"
+range-0/3/3:string:"Male"
+range-0/3/4:numeric:58
+range-0/4/0:numeric:2
+range-0/4/1:string:"Kelley"
+range-0/4/2:string:"Schelle"
+range-0/4/3:string:"Female"
+range-0/4/4:numeric:96
+range-0/5/0:numeric:2
+range-0/5/1:string:"Kelley"
+range-0/5/2:string:"Schelle"
+range-0/5/3:string:"Female"
+range-0/5/4:numeric:158
+range-0/6/0:numeric:2
+range-0/6/1:string:"Kelley"
+range-0/6/2:string:"Schelle"
+range-0/6/3:string:"Female"
+range-0/6/4:numeric:23
+range-0/7/0:numeric:2
+range-0/7/1:string:"Kelley"
+range-0/7/2:string:"Schelle"
+range-0/7/3:string:"Female"
+range-0/7/4:numeric:44
+range-0/8/0:numeric:3
+range-0/8/1:string:"Ashbey"
+range-0/8/2:string:"Fishly"
+range-0/8/3:string:"Male"
diff --git a/test/xml-mapped/nested-repeats-3/check.txt b/test/xml-mapped/nested-repeats-3/check.txt
new file mode 100644
index 0000000..33bc184
--- /dev/null
+++ b/test/xml-mapped/nested-repeats-3/check.txt
@@ -0,0 +1,44 @@
+data/0/0:string:"id"
+data/0/1:string:"first_name"
+data/0/2:string:"last_name"
+data/0/3:string:"gender"
+data/0/4:string:"score"
+data/1/0:numeric:1
+data/1/1:string:"Mace"
+data/1/2:string:"Stainton"
+data/1/3:string:"Male"
+data/1/4:numeric:39
+data/2/0:numeric:1
+data/2/1:string:"Mace"
+data/2/2:string:"Stainton"
+data/2/3:string:"Male"
+data/2/4:numeric:42
+data/3/0:numeric:1
+data/3/1:string:"Mace"
+data/3/2:string:"Stainton"
+data/3/3:string:"Male"
+data/3/4:numeric:58
+data/4/0:numeric:2
+data/4/1:string:"Kelley"
+data/4/2:string:"Schelle"
+data/4/3:string:"Female"
+data/4/4:numeric:96
+data/5/0:numeric:2
+data/5/1:string:"Kelley"
+data/5/2:string:"Schelle"
+data/5/3:string:"Female"
+data/5/4:numeric:158
+data/6/0:numeric:2
+data/6/1:string:"Kelley"
+data/6/2:string:"Schelle"
+data/6/3:string:"Female"
+data/6/4:numeric:23
+data/7/0:numeric:2
+data/7/1:string:"Kelley"
+data/7/2:string:"Schelle"
+data/7/3:string:"Female"
+data/7/4:numeric:44
+data/8/0:numeric:3
+data/8/1:string:"Ashbey"
+data/8/2:string:"Fishly"
+data/8/3:string:"Male"
diff --git a/test/xml-mapped/nested-repeats-3/input.xml b/test/xml-mapped/nested-repeats-3/input.xml
new file mode 100644
index 0000000..883142d
--- /dev/null
+++ b/test/xml-mapped/nested-repeats-3/input.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<dataset>
+ <record>
+ <id>1</id>
+ <first_name>Mace</first_name>
+ <last_name>Stainton</last_name>
+ <gender>Male</gender>
+ <scores>
+ <score>39</score>
+ <score>42</score>
+ <score>58</score>
+ </scores>
+ </record>
+ <record>
+ <id>2</id>
+ <first_name>Kelley</first_name>
+ <last_name>Schelle</last_name>
+ <gender>Female</gender>
+ <scores>
+ <score>96</score>
+ <score>158</score>
+ <score>23</score>
+ <score>44</score>
+ </scores>
+ </record>
+ <record>
+ <id>3</id>
+ <first_name>Ashbey</first_name>
+ <last_name>Fishly</last_name>
+ <gender>Male</gender>
+ </record>
+</dataset>
diff --git a/test/xml-mapped/nested-repeats-3/map.xml b/test/xml-mapped/nested-repeats-3/map.xml
new file mode 100644
index 0000000..ec0fdef
--- /dev/null
+++ b/test/xml-mapped/nested-repeats-3/map.xml
@@ -0,0 +1,13 @@
+<?xml version="1.0"?>
+<map xmlns="http://gitorious.org/orcus/xml-map">
+ <sheet name="data"/>
+ <range row="0" column="0" sheet="data">
+ <field path="/dataset/record/id"/>
+ <field path="/dataset/record/first_name"/>
+ <field path="/dataset/record/last_name"/>
+ <field path="/dataset/record/gender"/>
+ <field path="/dataset/record/scores/score"/>
+ <row-group path="/dataset/record"/>
+ <row-group path="/dataset/record/scores/score"/>
+ </range>
+</map>
diff --git a/test/xml-mapped/nested-repeats-4/check-nomap.txt b/test/xml-mapped/nested-repeats-4/check-nomap.txt
new file mode 100644
index 0000000..5b6d8ff
--- /dev/null
+++ b/test/xml-mapped/nested-repeats-4/check-nomap.txt
@@ -0,0 +1,44 @@
+range-0/0/0:string:"id"
+range-0/0/1:string:"first"
+range-0/0/2:string:"last"
+range-0/0/3:string:"gender"
+range-0/0/4:string:"score"
+range-0/1/0:numeric:1
+range-0/1/1:string:"Mace"
+range-0/1/2:string:"Stainton"
+range-0/1/3:string:"Male"
+range-0/1/4:numeric:39
+range-0/2/0:numeric:1
+range-0/2/1:string:"Mace"
+range-0/2/2:string:"Stainton"
+range-0/2/3:string:"Male"
+range-0/2/4:numeric:42
+range-0/3/0:numeric:1
+range-0/3/1:string:"Mace"
+range-0/3/2:string:"Stainton"
+range-0/3/3:string:"Male"
+range-0/3/4:numeric:58
+range-0/4/0:numeric:2
+range-0/4/1:string:"Kelley"
+range-0/4/2:string:"Schelle"
+range-0/4/3:string:"Female"
+range-0/4/4:numeric:96
+range-0/5/0:numeric:2
+range-0/5/1:string:"Kelley"
+range-0/5/2:string:"Schelle"
+range-0/5/3:string:"Female"
+range-0/5/4:numeric:158
+range-0/6/0:numeric:2
+range-0/6/1:string:"Kelley"
+range-0/6/2:string:"Schelle"
+range-0/6/3:string:"Female"
+range-0/6/4:numeric:23
+range-0/7/0:numeric:2
+range-0/7/1:string:"Kelley"
+range-0/7/2:string:"Schelle"
+range-0/7/3:string:"Female"
+range-0/7/4:numeric:44
+range-0/8/0:numeric:3
+range-0/8/1:string:"Ashbey"
+range-0/8/2:string:"Fishly"
+range-0/8/3:string:"Male"
diff --git a/test/xml-mapped/nested-repeats-4/check.txt b/test/xml-mapped/nested-repeats-4/check.txt
new file mode 100644
index 0000000..a576382
--- /dev/null
+++ b/test/xml-mapped/nested-repeats-4/check.txt
@@ -0,0 +1,44 @@
+data/0/0:string:"id"
+data/0/1:string:"first"
+data/0/2:string:"last"
+data/0/3:string:"gender"
+data/0/4:string:"score"
+data/1/0:numeric:1
+data/1/1:string:"Mace"
+data/1/2:string:"Stainton"
+data/1/3:string:"Male"
+data/1/4:numeric:39
+data/2/0:numeric:1
+data/2/1:string:"Mace"
+data/2/2:string:"Stainton"
+data/2/3:string:"Male"
+data/2/4:numeric:42
+data/3/0:numeric:1
+data/3/1:string:"Mace"
+data/3/2:string:"Stainton"
+data/3/3:string:"Male"
+data/3/4:numeric:58
+data/4/0:numeric:2
+data/4/1:string:"Kelley"
+data/4/2:string:"Schelle"
+data/4/3:string:"Female"
+data/4/4:numeric:96
+data/5/0:numeric:2
+data/5/1:string:"Kelley"
+data/5/2:string:"Schelle"
+data/5/3:string:"Female"
+data/5/4:numeric:158
+data/6/0:numeric:2
+data/6/1:string:"Kelley"
+data/6/2:string:"Schelle"
+data/6/3:string:"Female"
+data/6/4:numeric:23
+data/7/0:numeric:2
+data/7/1:string:"Kelley"
+data/7/2:string:"Schelle"
+data/7/3:string:"Female"
+data/7/4:numeric:44
+data/8/0:numeric:3
+data/8/1:string:"Ashbey"
+data/8/2:string:"Fishly"
+data/8/3:string:"Male"
diff --git a/test/xml-mapped/nested-repeats-4/input.xml b/test/xml-mapped/nested-repeats-4/input.xml
new file mode 100644
index 0000000..4f50b59
--- /dev/null
+++ b/test/xml-mapped/nested-repeats-4/input.xml
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<dataset>
+ <record>
+ <id>1</id>
+ <name>
+ <first>Mace</first>
+ <last>Stainton</last>
+ </name>
+ <gender>Male</gender>
+ <scores>
+ <score>39</score>
+ <score>42</score>
+ <score>58</score>
+ </scores>
+ </record>
+ <record>
+ <id>2</id>
+ <name>
+ <first>Kelley</first>
+ <last>Schelle</last>
+ </name>
+ <gender>Female</gender>
+ <scores>
+ <score>96</score>
+ <score>158</score>
+ <score>23</score>
+ <score>44</score>
+ </scores>
+ </record>
+ <record>
+ <id>3</id>
+ <name>
+ <first>Ashbey</first>
+ <last>Fishly</last>
+ </name>
+ <gender>Male</gender>
+ </record>
+</dataset>
diff --git a/test/xml-mapped/nested-repeats-4/map.xml b/test/xml-mapped/nested-repeats-4/map.xml
new file mode 100644
index 0000000..284bffe
--- /dev/null
+++ b/test/xml-mapped/nested-repeats-4/map.xml
@@ -0,0 +1,13 @@
+<?xml version="1.0"?>
+<map xmlns="http://gitorious.org/orcus/xml-map">
+ <sheet name="data"/>
+ <range row="0" column="0" sheet="data">
+ <field path="/dataset/record/id"/>
+ <field path="/dataset/record/name/first"/>
+ <field path="/dataset/record/name/last"/>
+ <field path="/dataset/record/gender"/>
+ <field path="/dataset/record/scores/score"/>
+ <row-group path="/dataset/record"/>
+ <row-group path="/dataset/record/scores/score"/>
+ </range>
+</map>
diff --git a/test/xml-mapped/nested-repeats/check-nomap.txt b/test/xml-mapped/nested-repeats/check-nomap.txt
new file mode 100644
index 0000000..2afd080
--- /dev/null
+++ b/test/xml-mapped/nested-repeats/check-nomap.txt
@@ -0,0 +1,20 @@
+range-0/0/0:string:"id"
+range-0/0/1:string:"ref"
+range-0/1/0:string:"A"
+range-0/1/1:numeric:123456789
+range-0/2/0:string:"A"
+range-0/2/1:numeric:987654321
+range-0/3/0:string:"B"
+range-0/3/1:numeric:1
+range-0/4/0:string:"B"
+range-0/4/1:numeric:2
+range-0/5/0:string:"B"
+range-0/5/1:numeric:3
+range-0/6/0:string:"C"
+range-0/6/1:numeric:1.1
+range-0/7/0:string:"C"
+range-0/7/1:numeric:2.2
+range-0/8/0:string:"C"
+range-0/8/1:numeric:3.3
+range-0/9/0:string:"C"
+range-0/9/1:numeric:4.4
diff --git a/test/xml-mapped/nested-repeats/check.txt b/test/xml-mapped/nested-repeats/check.txt
new file mode 100644
index 0000000..9672007
--- /dev/null
+++ b/test/xml-mapped/nested-repeats/check.txt
@@ -0,0 +1,20 @@
+data/0/0:string:"id"
+data/0/1:string:"ref"
+data/1/0:string:"A"
+data/1/1:numeric:123456789
+data/2/0:string:"A"
+data/2/1:numeric:987654321
+data/3/0:string:"B"
+data/3/1:numeric:1
+data/4/0:string:"B"
+data/4/1:numeric:2
+data/5/0:string:"B"
+data/5/1:numeric:3
+data/6/0:string:"C"
+data/6/1:numeric:1.1
+data/7/0:string:"C"
+data/7/1:numeric:2.2
+data/8/0:string:"C"
+data/8/1:numeric:3.3
+data/9/0:string:"C"
+data/9/1:numeric:4.4
diff --git a/test/xml-mapped/nested-repeats/input.xml b/test/xml-mapped/nested-repeats/input.xml
new file mode 100644
index 0000000..8828369
--- /dev/null
+++ b/test/xml-mapped/nested-repeats/input.xml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<osm version="0.6">
+ <way id="A">
+ <nd ref="123456789"/>
+ <nd ref="987654321"/>
+ </way>
+ <way id="B">
+ <nd ref="1"/>
+ <nd ref="2"/>
+ <nd ref="3"/>
+ </way>
+ <way id="C">
+ <nd ref="1.1"/>
+ <nd ref="2.2"/>
+ <nd ref="3.3"/>
+ <nd ref="4.4"/>
+ </way>
+</osm>
diff --git a/test/xml-mapped/nested-repeats/map.xml b/test/xml-mapped/nested-repeats/map.xml
new file mode 100644
index 0000000..60b1743
--- /dev/null
+++ b/test/xml-mapped/nested-repeats/map.xml
@@ -0,0 +1,10 @@
+<?xml version="1.0"?>
+<map xmlns="http://gitorious.org/orcus/xml-map">
+ <sheet name="data"/>
+ <range row="0" column="0" sheet="data">
+ <field path="/osm/way/@id"/>
+ <field path="/osm/way/nd/@ref"/>
+ <row-group path="/osm/way"/>
+ <row-group path="/osm/way/nd"/>
+ </range>
+</map>
diff --git a/test/xml-structure/attribute-1/check.txt b/test/xml-structure/attribute-1/check.txt
new file mode 100644
index 0000000..02bc1cb
--- /dev/null
+++ b/test/xml-structure/attribute-1/check.txt
@@ -0,0 +1,7 @@
+/root
+/root/@version
+/root/@type
+/root/entry[*]
+/root/entry[*]/@attr1
+/root/entry[*]/@attr2
+/root/entry[*]/@attr3
diff --git a/test/xml-structure/attribute-1/input.xml b/test/xml-structure/attribute-1/input.xml
new file mode 100644
index 0000000..fabfeda
--- /dev/null
+++ b/test/xml-structure/attribute-1/input.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0"?>
+<root version="2.1" type="a">
+ <entry attr1="val1" attr2="val2"/>
+ <entry attr2="val2" attr3="foo"/>
+</root>
diff --git a/test/xml-structure/basic-1/check.txt b/test/xml-structure/basic-1/check.txt
new file mode 100644
index 0000000..95e0737
--- /dev/null
+++ b/test/xml-structure/basic-1/check.txt
@@ -0,0 +1,5 @@
+/root
+/root/entry[*]
+/root/entry[*]/name
+/root/entry[*]/id
+
diff --git a/test/xml-structure/basic-1/input.xml b/test/xml-structure/basic-1/input.xml
new file mode 100644
index 0000000..e7c95a9
--- /dev/null
+++ b/test/xml-structure/basic-1/input.xml
@@ -0,0 +1,13 @@
+<?xml version="1.0"?>
+<!--When recurring elements contain inconsistent set of child elements, we assume that such element structurally contain union of all encountered child elements. -->
+<root>
+ <entry>
+ <name>Foo</name>
+ </entry>
+ <entry>
+ <id>12</id>
+ </entry>
+ <entry>
+ <name>Bah</name>
+ </entry>
+</root>
diff --git a/test/xml-structure/basic-2/check.txt b/test/xml-structure/basic-2/check.txt
new file mode 100644
index 0000000..2072ab1
--- /dev/null
+++ b/test/xml-structure/basic-2/check.txt
@@ -0,0 +1,5 @@
+/root
+/root/name
+/root/age
+/root/nickname
+
diff --git a/test/xml-structure/basic-2/input.xml b/test/xml-structure/basic-2/input.xml
new file mode 100644
index 0000000..1466be4
--- /dev/null
+++ b/test/xml-structure/basic-2/input.xml
@@ -0,0 +1,7 @@
+<?xml version="1.0"?>
+<!--This one has no recurring sub-structure at all.-->
+<root>
+ <name>Thomas Anderson</name>
+ <age>unknown</age>
+ <nickname>Neo</nickname>
+</root>
diff --git a/test/xml-structure/basic-3/check.txt b/test/xml-structure/basic-3/check.txt
new file mode 100644
index 0000000..81a05a6
--- /dev/null
+++ b/test/xml-structure/basic-3/check.txt
@@ -0,0 +1,9 @@
+/data
+/data/entries
+/data/entries/entry[*]
+/data/entries/entry[*]/id
+/data/entries/entry[*]/name
+/data/entries/entry[*]/name/first
+/data/entries/entry[*]/name/last
+/data/entries/entry[*]/nickname
+/data/entries/entry[*]/gender
diff --git a/test/xml-structure/basic-3/input.xml b/test/xml-structure/basic-3/input.xml
new file mode 100644
index 0000000..4eee597
--- /dev/null
+++ b/test/xml-structure/basic-3/input.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0"?>
+<data>
+ <entries>
+ <entry>
+ <id>0</id>
+ <name>
+ <first>Thomas</first>
+ <last>Anderson</last>
+ </name>
+ <nickname>Neo</nickname>
+ <gender>male</gender>
+ </entry>
+ <entry>
+ <id>1</id>
+ <nickname>Trinity</nickname>
+ <gender>female</gender>
+ </entry>
+ </entries>
+</data>
diff --git a/test/xml-structure/namespace-default/check.txt b/test/xml-structure/namespace-default/check.txt
new file mode 100644
index 0000000..811b06b
--- /dev/null
+++ b/test/xml-structure/namespace-default/check.txt
@@ -0,0 +1,5 @@
+ns0="http://test.test.org/"
+/ns0:root
+/ns0:root/ns0:entry
+/ns0:root/ns0:entry/ns0:name
+
diff --git a/test/xml-structure/namespace-default/input.xml b/test/xml-structure/namespace-default/input.xml
new file mode 100644
index 0000000..012dd06
--- /dev/null
+++ b/test/xml-structure/namespace-default/input.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0"?>
+<root xmlns="http://test.test.org/">
+ <entry>
+ <name>Foo</name>
+ </entry>
+</root>
diff --git a/test/xml-structure/nested-repeat-1/check.txt b/test/xml-structure/nested-repeat-1/check.txt
new file mode 100644
index 0000000..8d6380e
--- /dev/null
+++ b/test/xml-structure/nested-repeat-1/check.txt
@@ -0,0 +1,12 @@
+/root
+/root/mode
+/root/mode/insert[*]
+/root/mode/insert[*]/command
+/root/mode/insert[*]/command/@name
+/root/mode/remove[*]
+/root/mode/remove[*]/command
+/root/mode/remove[*]/command/@name
+/root/mode/edit
+/root/mode/edit/command
+/root/mode/edit/command/@name
+
diff --git a/test/xml-structure/nested-repeat-1/input.xml b/test/xml-structure/nested-repeat-1/input.xml
new file mode 100644
index 0000000..9f190cc
--- /dev/null
+++ b/test/xml-structure/nested-repeat-1/input.xml
@@ -0,0 +1,20 @@
+<?xml version="1.0"?>
+<root>
+ <mode>
+ <insert>
+ <command name="foo"/>
+ </insert>
+ <remove>
+ <command name="foo"/>
+ </remove>
+ <insert>
+ <command name="baa"/>
+ </insert>
+ <remove>
+ <command name="baa"/>
+ </remove>
+ <edit>
+ <command name="non-repeat"/>
+ </edit>
+ </mode>
+</root>
diff --git a/test/xml/bom/check.txt b/test/xml/bom/check.txt
new file mode 100644
index 0000000..3ec9051
--- /dev/null
+++ b/test/xml/bom/check.txt
@@ -0,0 +1,11 @@
+ns0="http://schemas.openxmlformats.org/package/2006/content-types"
+/ns0:Types
+/ns0:Types/ns0:Default
+/ns0:Types/ns0:Default@ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml"
+/ns0:Types/ns0:Default@Extension="xml"
+/ns0:Types/ns0:Default
+/ns0:Types/ns0:Default@ContentType="application/vnd.openxmlformats-package.relationships+xml"
+/ns0:Types/ns0:Default@Extension="rels"
+/ns0:Types/ns0:Override
+/ns0:Types/ns0:Override@ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml"
+/ns0:Types/ns0:Override@PartName="/xl/worksheets/sheet.xml"
diff --git a/test/xml/bom/input.xml b/test/xml/bom/input.xml
new file mode 100644
index 0000000..2a7290b
--- /dev/null
+++ b/test/xml/bom/input.xml
@@ -0,0 +1 @@
+<?xml version="1.0" encoding="utf-8"?><Types xmlns="http://schemas.openxmlformats.org/package/2006/content-types"><Default Extension="xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml" /><Default Extension="rels" ContentType="application/vnd.openxmlformats-package.relationships+xml" /><Override PartName="/xl/worksheets/sheet.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml" /></Types> \ No newline at end of file
diff --git a/test/xml/cdata-1/check.txt b/test/xml/cdata-1/check.txt
new file mode 100644
index 0000000..27bb3fe
--- /dev/null
+++ b/test/xml/cdata-1/check.txt
@@ -0,0 +1,18 @@
+/root
+/root/header
+/root/header"simple text"
+/root/header
+/root/header"[[inside double braces]]"
+/root/header
+/root/header"multiple"
+/root/header"CDATA"
+/root/header"in succession"
+/root/header
+/root/header"<html><body>...</body></html>"
+/root/header
+/root/header"!@#$%^&*()"
+/root/header
+/root/header"$amp;"
+/root/header
+/root/header"Normal character data and"
+/root/header"CDATA"
diff --git a/test/xml/cdata-1/input.xml b/test/xml/cdata-1/input.xml
new file mode 100644
index 0000000..d5f4e5f
--- /dev/null
+++ b/test/xml/cdata-1/input.xml
@@ -0,0 +1,10 @@
+<?xml version="1.0"?>
+<root>
+ <header><![CDATA[simple text]]></header>
+ <header><![CDATA[[[inside double braces]]]]></header>
+ <header><![CDATA[multiple]]><![CDATA[CDATA]]><![CDATA[in succession]]></header>
+ <header><![CDATA[<html><body>...</body></html>]]></header><!-- make sure tags are not parsed as xml -->
+ <header><![CDATA[!@#$%^&*()]]></header>
+ <header><![CDATA[$amp;]]></header><!-- encoded characters are taken literally without decoding -->
+ <header>Normal character data and <![CDATA[CDATA]]></header>
+</root>
diff --git a/test/xml/custom-decl-1/check.txt b/test/xml/custom-decl-1/check.txt
new file mode 100644
index 0000000..ac564ae
--- /dev/null
+++ b/test/xml/custom-decl-1/check.txt
@@ -0,0 +1,99 @@
+ns0="urn:schemas-microsoft-com:office:spreadsheet"
+ns1="urn:schemas-microsoft-com:office:component:spreadsheet"
+ns2="http://www.w3.org/TR/REC-html40"
+ns3="urn:schemas-microsoft-com:office:office"
+ns4="http://schemas.microsoft.com/office/excel/2003/xml"
+ns5="urn:schemas-microsoft-com:office:excel"
+ns6="http://www.w3.org/2001/XMLSchema-instance"
+/ns0:Workbook
+/ns0:Workbook/ns3:OfficeDocumentSettings
+/ns0:Workbook/ns3:OfficeDocumentSettings/ns3:Colors
+/ns0:Workbook/ns3:OfficeDocumentSettings/ns3:Colors/ns3:Color
+/ns0:Workbook/ns3:OfficeDocumentSettings/ns3:Colors/ns3:Color/ns3:Index
+/ns0:Workbook/ns3:OfficeDocumentSettings/ns3:Colors/ns3:Color/ns3:Index"3"
+/ns0:Workbook/ns3:OfficeDocumentSettings/ns3:Colors/ns3:Color/ns3:RGB
+/ns0:Workbook/ns3:OfficeDocumentSettings/ns3:Colors/ns3:Color/ns3:RGB"#c0c0c0"
+/ns0:Workbook/ns3:OfficeDocumentSettings/ns3:Colors/ns3:Color
+/ns0:Workbook/ns3:OfficeDocumentSettings/ns3:Colors/ns3:Color/ns3:Index
+/ns0:Workbook/ns3:OfficeDocumentSettings/ns3:Colors/ns3:Color/ns3:Index"4"
+/ns0:Workbook/ns3:OfficeDocumentSettings/ns3:Colors/ns3:Color/ns3:RGB
+/ns0:Workbook/ns3:OfficeDocumentSettings/ns3:Colors/ns3:Color/ns3:RGB"#ff0000"
+/ns0:Workbook/ns5:ExcelWorkbook
+/ns0:Workbook/ns5:ExcelWorkbook/ns5:WindowHeight
+/ns0:Workbook/ns5:ExcelWorkbook/ns5:WindowHeight"9000"
+/ns0:Workbook/ns5:ExcelWorkbook/ns5:WindowWidth
+/ns0:Workbook/ns5:ExcelWorkbook/ns5:WindowWidth"13860"
+/ns0:Workbook/ns5:ExcelWorkbook/ns5:WindowTopX
+/ns0:Workbook/ns5:ExcelWorkbook/ns5:WindowTopX"240"
+/ns0:Workbook/ns5:ExcelWorkbook/ns5:WindowTopY
+/ns0:Workbook/ns5:ExcelWorkbook/ns5:WindowTopY"75"
+/ns0:Workbook/ns5:ExcelWorkbook/ns5:ProtectStructure
+/ns0:Workbook/ns5:ExcelWorkbook/ns5:ProtectStructure"False"
+/ns0:Workbook/ns5:ExcelWorkbook/ns5:ProtectWindows
+/ns0:Workbook/ns5:ExcelWorkbook/ns5:ProtectWindows"False"
+/ns0:Workbook/ns0:Styles
+/ns0:Workbook/ns0:Styles/ns0:Style
+/ns0:Workbook/ns0:Styles/ns0:Style@ns0:ID="Default"
+/ns0:Workbook/ns0:Styles/ns0:Style@ns0:Name="Default"
+/ns0:Workbook/ns0:Styles/ns0:Style
+/ns0:Workbook/ns0:Styles/ns0:Style@ns0:ID="Result"
+/ns0:Workbook/ns0:Styles/ns0:Style@ns0:Name="Result"
+/ns0:Workbook/ns0:Styles/ns0:Style/ns0:Font
+/ns0:Workbook/ns0:Styles/ns0:Style/ns0:Font@ns0:Bold="1"
+/ns0:Workbook/ns0:Styles/ns0:Style/ns0:Font@ns0:Italic="1"
+/ns0:Workbook/ns0:Styles/ns0:Style/ns0:Font@ns0:Underline="Single"
+/ns0:Workbook/ns0:Styles/ns0:Style
+/ns0:Workbook/ns0:Styles/ns0:Style@ns0:ID="Result2"
+/ns0:Workbook/ns0:Styles/ns0:Style@ns0:Name="Result2"
+/ns0:Workbook/ns0:Styles/ns0:Style/ns0:Font
+/ns0:Workbook/ns0:Styles/ns0:Style/ns0:Font@ns0:Bold="1"
+/ns0:Workbook/ns0:Styles/ns0:Style/ns0:Font@ns0:Italic="1"
+/ns0:Workbook/ns0:Styles/ns0:Style/ns0:Font@ns0:Underline="Single"
+/ns0:Workbook/ns0:Styles/ns0:Style/ns0:NumberFormat
+/ns0:Workbook/ns0:Styles/ns0:Style/ns0:NumberFormat@ns0:Format="Currency"
+/ns0:Workbook/ns0:Styles/ns0:Style
+/ns0:Workbook/ns0:Styles/ns0:Style@ns0:ID="Heading"
+/ns0:Workbook/ns0:Styles/ns0:Style@ns0:Name="Heading"
+/ns0:Workbook/ns0:Styles/ns0:Style/ns0:Font
+/ns0:Workbook/ns0:Styles/ns0:Style/ns0:Font@ns0:Bold="1"
+/ns0:Workbook/ns0:Styles/ns0:Style/ns0:Font@ns0:Italic="1"
+/ns0:Workbook/ns0:Styles/ns0:Style/ns0:Font@ns0:Size="16"
+/ns0:Workbook/ns0:Styles/ns0:Style
+/ns0:Workbook/ns0:Styles/ns0:Style@ns0:ID="Heading1"
+/ns0:Workbook/ns0:Styles/ns0:Style@ns0:Name="Heading1"
+/ns0:Workbook/ns0:Styles/ns0:Style/ns0:Font
+/ns0:Workbook/ns0:Styles/ns0:Style/ns0:Font@ns0:Bold="1"
+/ns0:Workbook/ns0:Styles/ns0:Style/ns0:Font@ns0:Italic="1"
+/ns0:Workbook/ns0:Styles/ns0:Style/ns0:Font@ns0:Size="16"
+/ns0:Workbook/ns0:Styles/ns0:Style
+/ns0:Workbook/ns0:Styles/ns0:Style@ns0:ID="co1"
+/ns0:Workbook/ns0:Styles/ns0:Style
+/ns0:Workbook/ns0:Styles/ns0:Style@ns0:ID="ta1"
+/ns0:Workbook/ns0:Worksheet
+/ns0:Workbook/ns0:Worksheet@ns0:Name="Sheet1"
+/ns0:Workbook/ns0:Worksheet/ns0:Table
+/ns0:Workbook/ns0:Worksheet/ns0:Table@ns0:StyleID="ta1"
+/ns0:Workbook/ns0:Worksheet/ns0:Table/ns0:Column
+/ns0:Workbook/ns0:Worksheet/ns0:Table/ns0:Column@ns0:Span="1"
+/ns0:Workbook/ns0:Worksheet/ns0:Table/ns0:Column@ns0:Width="64.0063"
+/ns0:Workbook/ns0:Worksheet/ns0:Table/ns0:Row
+/ns0:Workbook/ns0:Worksheet/ns0:Table/ns0:Row@ns0:Height="12.8126"
+/ns0:Workbook/ns0:Worksheet/ns0:Table/ns0:Row/ns0:Cell
+/ns0:Workbook/ns0:Worksheet/ns0:Table/ns0:Row/ns0:Cell/ns0:Data
+/ns0:Workbook/ns0:Worksheet/ns0:Table/ns0:Row/ns0:Cell/ns0:Data@ns0:Type="String"
+/ns0:Workbook/ns0:Worksheet/ns0:Table/ns0:Row/ns0:Cell/ns0:Data"a"
+/ns0:Workbook/ns0:Worksheet/ns0:Table/ns0:Row/ns0:Cell
+/ns0:Workbook/ns0:Worksheet/ns0:Table/ns0:Row/ns0:Cell/ns0:Data
+/ns0:Workbook/ns0:Worksheet/ns0:Table/ns0:Row/ns0:Cell/ns0:Data@ns0:Type="String"
+/ns0:Workbook/ns0:Worksheet/ns0:Table/ns0:Row/ns0:Cell/ns0:Data"b"
+/ns0:Workbook/ns0:Worksheet/ns0:Table/ns0:Row
+/ns0:Workbook/ns0:Worksheet/ns0:Table/ns0:Row@ns0:Height="12.8126"
+/ns0:Workbook/ns0:Worksheet/ns0:Table/ns0:Row/ns0:Cell
+/ns0:Workbook/ns0:Worksheet/ns0:Table/ns0:Row/ns0:Cell/ns0:Data
+/ns0:Workbook/ns0:Worksheet/ns0:Table/ns0:Row/ns0:Cell/ns0:Data@ns0:Type="String"
+/ns0:Workbook/ns0:Worksheet/ns0:Table/ns0:Row/ns0:Cell/ns0:Data"c"
+/ns0:Workbook/ns0:Worksheet/ns0:Table/ns0:Row/ns0:Cell
+/ns0:Workbook/ns0:Worksheet/ns0:Table/ns0:Row/ns0:Cell/ns0:Data
+/ns0:Workbook/ns0:Worksheet/ns0:Table/ns0:Row/ns0:Cell/ns0:Data@ns0:Type="String"
+/ns0:Workbook/ns0:Worksheet/ns0:Table/ns0:Row/ns0:Cell/ns0:Data"d"
+/ns0:Workbook/ns0:Worksheet/ns5:WorksheetOptions
diff --git a/test/xml/custom-decl-1/input.xml b/test/xml/custom-decl-1/input.xml
new file mode 100644
index 0000000..146ee57
--- /dev/null
+++ b/test/xml/custom-decl-1/input.xml
@@ -0,0 +1,3 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?mso-application progid="Excel.Sheet"?>
+<Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet" xmlns:c="urn:schemas-microsoft-com:office:component:spreadsheet" xmlns:html="http://www.w3.org/TR/REC-html40" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet" xmlns:x2="http://schemas.microsoft.com/office/excel/2003/xml" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><OfficeDocumentSettings xmlns="urn:schemas-microsoft-com:office:office"><Colors><Color><Index>3</Index><RGB>#c0c0c0</RGB></Color><Color><Index>4</Index><RGB>#ff0000</RGB></Color></Colors></OfficeDocumentSettings><ExcelWorkbook xmlns="urn:schemas-microsoft-com:office:excel"><WindowHeight>9000</WindowHeight><WindowWidth>13860</WindowWidth><WindowTopX>240</WindowTopX><WindowTopY>75</WindowTopY><ProtectStructure>False</ProtectStructure><ProtectWindows>False</ProtectWindows></ExcelWorkbook><Styles><Style ss:ID="Default" ss:Name="Default"/><Style ss:ID="Result" ss:Name="Result"><Font ss:Bold="1" ss:Italic="1" ss:Underline="Single"/></Style><Style ss:ID="Result2" ss:Name="Result2"><Font ss:Bold="1" ss:Italic="1" ss:Underline="Single"/><NumberFormat ss:Format="Currency"/></Style><Style ss:ID="Heading" ss:Name="Heading"><Font ss:Bold="1" ss:Italic="1" ss:Size="16"/></Style><Style ss:ID="Heading1" ss:Name="Heading1"><Font ss:Bold="1" ss:Italic="1" ss:Size="16"/></Style><Style ss:ID="co1"/><Style ss:ID="ta1"/></Styles><ss:Worksheet ss:Name="Sheet1"><Table ss:StyleID="ta1"><Column ss:Span="1" ss:Width="64.0063"/><Row ss:Height="12.8126"><Cell><Data ss:Type="String">a</Data></Cell><Cell><Data ss:Type="String">b</Data></Cell></Row><Row ss:Height="12.8126"><Cell><Data ss:Type="String">c</Data></Cell><Cell><Data ss:Type="String">d</Data></Cell></Row></Table><x:WorksheetOptions/></ss:Worksheet></Workbook> \ No newline at end of file
diff --git a/test/xml/default-ns/check.txt b/test/xml/default-ns/check.txt
new file mode 100644
index 0000000..1497b8d
--- /dev/null
+++ b/test/xml/default-ns/check.txt
@@ -0,0 +1,17 @@
+ns0="http://some.xmlns.org/1.0"
+ns1="http://some.xmlns.org/2.0"
+/ns0:data
+/ns0:data/ns0:entries
+/ns0:data/ns0:entries@count="2"
+/ns0:data/ns0:entries/ns0:entry
+/ns0:data/ns0:entries/ns0:entry"Foo"
+/ns0:data/ns0:entries/ns0:entry
+/ns0:data/ns0:entries/ns0:entry"Baa"
+/ns0:data/ns1:entries
+/ns0:data/ns1:entries@count="3"
+/ns0:data/ns1:entries/ns1:entry
+/ns0:data/ns1:entries/ns1:entry@value="One"
+/ns0:data/ns1:entries/ns1:entry
+/ns0:data/ns1:entries/ns1:entry@value="Two"
+/ns0:data/ns1:entries/ns1:entry
+/ns0:data/ns1:entries/ns1:entry@value="Three"
diff --git a/test/xml/default-ns/input.xml b/test/xml/default-ns/input.xml
new file mode 100644
index 0000000..ec69874
--- /dev/null
+++ b/test/xml/default-ns/input.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0"?>
+<data xmlns="http://some.xmlns.org/1.0">
+ <entries count="2">
+ <entry>Foo</entry>
+ <entry>Baa</entry>
+ </entries>
+ <entries xmlns="http://some.xmlns.org/2.0" count="3">
+ <entry value="One"/>
+ <entry value="Two"/>
+ <entry value="Three"/>
+ </entries>
+</data>
diff --git a/test/xml/doctype/html.xml b/test/xml/doctype/html.xml
new file mode 100644
index 0000000..1d37890
--- /dev/null
+++ b/test/xml/doctype/html.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0"?>
+<!DOCTYPE html PUBLIC
+ "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html>
+ <body></body>
+</html>
diff --git a/test/xml/encoded-attrs/test1.xml b/test/xml/encoded-attrs/test1.xml
new file mode 100644
index 0000000..ffce99c
--- /dev/null
+++ b/test/xml/encoded-attrs/test1.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+ <elem attr1="1 &amp; 2" attr2="3 &amp; 4" attr3="5 &amp; 6"/>
+</root>
+
diff --git a/test/xml/encoded-char/check.txt b/test/xml/encoded-char/check.txt
new file mode 100644
index 0000000..5aba73d
--- /dev/null
+++ b/test/xml/encoded-char/check.txt
@@ -0,0 +1,19 @@
+/root
+/root/data
+/root/data"Tom & Jerry"
+/root/data
+/root/data@attr="Black & Whilte"
+/root/data@attr2="'quoted'"
+/root/data"This is 'single-quoted', and this is \"double-quoted\"."
+/root/data
+/root/data@attr="<>'\"&"
+/root/data"Less than (<) and greater than (>) are also encoded."
+/root/data
+/root/data"<>'\"&"
+/root/data
+/root/data@single-char="&"
+/root/data">"
+/root/data
+/root/data"\"B\";"
+/root/data
+/root/data"\";\""
diff --git a/test/xml/encoded-char/input.xml b/test/xml/encoded-char/input.xml
new file mode 100644
index 0000000..289fc57
--- /dev/null
+++ b/test/xml/encoded-char/input.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Test for correctly converting encoded characters. -->
+<root>
+ <data>Tom &amp; Jerry</data>
+ <data attr="Black &amp; Whilte" attr2="&apos;quoted&apos;">This is &apos;single-quoted&apos;, and this is &quot;double-quoted&quot;.</data>
+ <data attr="&lt;&gt;&apos;&quot;&amp;">Less than (&lt;) and greater than (&gt;) are also encoded.</data>
+ <data>&lt;&gt;&apos;&quot;&amp;</data>
+ <data single-char="&amp;">&gt;</data>
+ <data>&quot;B&quot;;</data>
+ <data>&quot;;&quot;</data>
+</root>
diff --git a/test/xml/invalids/double-boms-and-invalid-byte.xml b/test/xml/invalids/double-boms-and-invalid-byte.xml
new file mode 100644
index 0000000..43254d2
--- /dev/null
+++ b/test/xml/invalids/double-boms-and-invalid-byte.xml
@@ -0,0 +1 @@
+<?xml version="1.0" ?><root/> \ No newline at end of file
diff --git a/test/xml/invalids/only-bom.xml b/test/xml/invalids/only-bom.xml
new file mode 100644
index 0000000..5f28270
--- /dev/null
+++ b/test/xml/invalids/only-bom.xml
@@ -0,0 +1 @@
+ \ No newline at end of file
diff --git a/test/xml/invalids/only-double-boms.xml b/test/xml/invalids/only-double-boms.xml
new file mode 100644
index 0000000..83ea941
--- /dev/null
+++ b/test/xml/invalids/only-double-boms.xml
@@ -0,0 +1 @@
+ \ No newline at end of file
diff --git a/test/xml/invalids/partial-attr-value-with-encoding-char.xml b/test/xml/invalids/partial-attr-value-with-encoding-char.xml
new file mode 100644
index 0000000..a0237ab
--- /dev/null
+++ b/test/xml/invalids/partial-attr-value-with-encoding-char.xml
@@ -0,0 +1,2 @@
+<?xml version="1.0"?>
+<root attr="encoding char is present &amp; no closing quote.
diff --git a/test/xml/invalids/partial-open-element.xml b/test/xml/invalids/partial-open-element.xml
new file mode 100644
index 0000000..7f93d4f
--- /dev/null
+++ b/test/xml/invalids/partial-open-element.xml
@@ -0,0 +1,2 @@
+<?xml version="1.0"?>
+<root
diff --git a/test/xml/no-decl-1/check.txt b/test/xml/no-decl-1/check.txt
new file mode 100644
index 0000000..4b84925
--- /dev/null
+++ b/test/xml/no-decl-1/check.txt
@@ -0,0 +1,8 @@
+/root
+/root/child
+/root/child
+/root/child@attr1="value1"
+/root/child@attr2="value2"
+/root/child
+/root/child/baby
+/root/child/baby"some text"
diff --git a/test/xml/no-decl-1/input.xml b/test/xml/no-decl-1/input.xml
new file mode 100644
index 0000000..fc938d4
--- /dev/null
+++ b/test/xml/no-decl-1/input.xml
@@ -0,0 +1,8 @@
+<root>
+ <child/>
+ <child attr2="value2" attr1="value1"/>
+ <child>
+ <baby>some text</baby>
+ </child>
+</root>
+
diff --git a/test/xml/ns-alias-1/check.txt b/test/xml/ns-alias-1/check.txt
new file mode 100644
index 0000000..7a2225e
--- /dev/null
+++ b/test/xml/ns-alias-1/check.txt
@@ -0,0 +1,10 @@
+ns0="http://default-namespace"
+ns1="http://namespace-1"
+ns2="http://namespace-2"
+/ns1:data
+/ns1:data/ns0:entry
+/ns1:data/ns0:entry"Default"
+/ns1:data/ns1:entry
+/ns1:data/ns1:entry"Inside 1"
+/ns1:data/ns2:entry
+/ns1:data/ns2:entry"Inside 2"
diff --git a/test/xml/ns-alias-1/input.xml b/test/xml/ns-alias-1/input.xml
new file mode 100644
index 0000000..250064a
--- /dev/null
+++ b/test/xml/ns-alias-1/input.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0"?>
+<a:data xmlns="http://default-namespace" xmlns:a="http://namespace-1" xmlns:b="http://namespace-2">
+ <entry>Default</entry>
+ <a:entry>Inside 1</a:entry>
+ <b:entry>Inside 2</b:entry>
+</a:data>
diff --git a/test/xml/osm/street-in-aizu.osm b/test/xml/osm/street-in-aizu.osm
new file mode 100644
index 0000000..2958bb4
--- /dev/null
+++ b/test/xml/osm/street-in-aizu.osm
@@ -0,0 +1,227 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<osm version="0.6" generator="CGImap 0.6.1 (1984 thorn-02.openstreetmap.org)" copyright="OpenStreetMap and contributors" attribution="http://www.openstreetmap.org/copyright" license="http://opendatacommons.org/licenses/odbl/1-0/">
+ <bounds minlat="37.4793300" minlon="139.9158300" maxlat="37.4798000" maxlon="139.9162300"/>
+ <node id="755713171" visible="true" version="3" changeset="26166007" timestamp="2014-10-18T08:39:27Z" user="jun_meguro" uid="279283" lat="37.4793416" lon="139.9160310"/>
+ <node id="761578574" visible="true" version="3" changeset="34357111" timestamp="2015-09-30T22:02:58Z" user="DannyAiquipa" uid="2226712" lat="37.4793344" lon="139.9158428"/>
+ <node id="761578575" visible="true" version="2" changeset="16173374" timestamp="2013-05-17T21:30:31Z" user="jun_meguro" uid="279283" lat="37.4797907" lon="139.9157685"/>
+ <node id="761578576" visible="true" version="2" changeset="16173374" timestamp="2013-05-17T21:30:31Z" user="jun_meguro" uid="279283" lat="37.4801316" lon="139.9157429"/>
+ <node id="2308855657" visible="true" version="3" changeset="53955991" timestamp="2017-11-20T17:45:36Z" user="jun_meguro" uid="279283" lat="37.4791258" lon="139.9161905">
+ <tag k="highway" v="crossing"/>
+ </node>
+ <node id="2308855711" visible="true" version="3" changeset="53955991" timestamp="2017-11-20T17:45:36Z" user="jun_meguro" uid="279283" lat="37.4792845" lon="139.9163414">
+ <tag k="highway" v="traffic_signals"/>
+ </node>
+ <node id="2308855735" visible="true" version="3" changeset="39933437" timestamp="2016-06-10T15:59:44Z" user="jun_meguro" uid="279283" lat="37.4793437" lon="139.9161752">
+ <tag k="highway" v="crossing"/>
+ </node>
+ <node id="2342696889" visible="true" version="2" changeset="34357111" timestamp="2015-09-30T22:02:58Z" user="DannyAiquipa" uid="2226712" lat="37.4792636" lon="139.9145748"/>
+ <node id="2342697034" visible="true" version="1" changeset="16530860" timestamp="2013-06-12T22:40:59Z" user="jun_meguro" uid="279283" lat="37.4797682" lon="139.9160743"/>
+ <node id="2342697041" visible="true" version="2" changeset="39933437" timestamp="2016-06-10T15:59:44Z" user="jun_meguro" uid="279283" lat="37.4797768" lon="139.9163279"/>
+ <node id="2343446366" visible="true" version="1" changeset="16539371" timestamp="2013-06-13T15:58:17Z" user="jun_meguro" uid="279283" lat="37.4793697" lon="139.9158791"/>
+ <node id="2343446367" visible="true" version="1" changeset="16539371" timestamp="2013-06-13T15:58:17Z" user="jun_meguro" uid="279283" lat="37.4793745" lon="139.9160509"/>
+ <node id="2343446368" visible="true" version="1" changeset="16539371" timestamp="2013-06-13T15:58:17Z" user="jun_meguro" uid="279283" lat="37.4793778" lon="139.9161283"/>
+ <node id="2343446369" visible="true" version="1" changeset="16539371" timestamp="2013-06-13T15:58:17Z" user="jun_meguro" uid="279283" lat="37.4793790" lon="139.9159997"/>
+ <node id="2343446370" visible="true" version="1" changeset="16539371" timestamp="2013-06-13T15:58:17Z" user="jun_meguro" uid="279283" lat="37.4794417" lon="139.9161239"/>
+ <node id="2343446371" visible="true" version="1" changeset="16539371" timestamp="2013-06-13T15:58:17Z" user="jun_meguro" uid="279283" lat="37.4794428" lon="139.9161500"/>
+ <node id="2343446372" visible="true" version="1" changeset="16539371" timestamp="2013-06-13T15:58:17Z" user="jun_meguro" uid="279283" lat="37.4794436" lon="139.9158701"/>
+ <node id="2343446373" visible="true" version="1" changeset="16539371" timestamp="2013-06-13T15:58:17Z" user="jun_meguro" uid="279283" lat="37.4794529" lon="139.9159907"/>
+ <node id="2343446374" visible="true" version="1" changeset="16539371" timestamp="2013-06-13T15:58:17Z" user="jun_meguro" uid="279283" lat="37.4794967" lon="139.9160426"/>
+ <node id="2343446375" visible="true" version="1" changeset="16539371" timestamp="2013-06-13T15:58:17Z" user="jun_meguro" uid="279283" lat="37.4795007" lon="139.9158986"/>
+ <node id="2343446376" visible="true" version="1" changeset="16539371" timestamp="2013-06-13T15:58:17Z" user="jun_meguro" uid="279283" lat="37.4795007" lon="139.9160191"/>
+ <node id="2343446377" visible="true" version="1" changeset="16539371" timestamp="2013-06-13T15:58:17Z" user="jun_meguro" uid="279283" lat="37.4795012" lon="139.9161460"/>
+ <node id="2343446378" visible="true" version="1" changeset="16539371" timestamp="2013-06-13T15:58:17Z" user="jun_meguro" uid="279283" lat="37.4795089" lon="139.9160771"/>
+ <node id="2343446379" visible="true" version="1" changeset="16539371" timestamp="2013-06-13T15:58:17Z" user="jun_meguro" uid="279283" lat="37.4795140" lon="139.9161548"/>
+ <node id="2343446380" visible="true" version="1" changeset="16539371" timestamp="2013-06-13T15:58:17Z" user="jun_meguro" uid="279283" lat="37.4795738" lon="139.9158986"/>
+ <node id="2343446381" visible="true" version="1" changeset="16539371" timestamp="2013-06-13T15:58:17Z" user="jun_meguro" uid="279283" lat="37.4795738" lon="139.9160191"/>
+ <node id="2343446382" visible="true" version="1" changeset="16539371" timestamp="2013-06-13T15:58:17Z" user="jun_meguro" uid="279283" lat="37.4796391" lon="139.9158794"/>
+ <node id="2343446383" visible="true" version="1" changeset="16539371" timestamp="2013-06-13T15:58:17Z" user="jun_meguro" uid="279283" lat="37.4796457" lon="139.9160167"/>
+ <node id="2343446384" visible="true" version="1" changeset="16539371" timestamp="2013-06-13T15:58:17Z" user="jun_meguro" uid="279283" lat="37.4797160" lon="139.9158734"/>
+ <node id="2343446385" visible="true" version="1" changeset="16539371" timestamp="2013-06-13T15:58:17Z" user="jun_meguro" uid="279283" lat="37.4797189" lon="139.9160554"/>
+ <node id="2343446386" visible="true" version="1" changeset="16539371" timestamp="2013-06-13T15:58:17Z" user="jun_meguro" uid="279283" lat="37.4797226" lon="139.9160108"/>
+ <node id="2343446387" visible="true" version="1" changeset="16539371" timestamp="2013-06-13T15:58:17Z" user="jun_meguro" uid="279283" lat="37.4797240" lon="139.9161330"/>
+ <node id="2343446388" visible="true" version="1" changeset="16539371" timestamp="2013-06-13T15:58:17Z" user="jun_meguro" uid="279283" lat="37.4797439" lon="139.9159353"/>
+ <node id="2343446389" visible="true" version="1" changeset="16539371" timestamp="2013-06-13T15:58:17Z" user="jun_meguro" uid="279283" lat="37.4797466" lon="139.9160492"/>
+ <node id="2343446390" visible="true" version="1" changeset="16539371" timestamp="2013-06-13T15:58:17Z" user="jun_meguro" uid="279283" lat="37.4797864" lon="139.9159337"/>
+ <node id="2343446391" visible="true" version="1" changeset="16539371" timestamp="2013-06-13T15:58:17Z" user="jun_meguro" uid="279283" lat="37.4797891" lon="139.9160476"/>
+ <node id="3136449574" visible="true" version="1" changeset="26166007" timestamp="2014-10-18T08:39:20Z" user="jun_meguro" uid="279283" lat="37.4792352" lon="139.9141591"/>
+ <node id="3136449575" visible="true" version="1" changeset="26166007" timestamp="2014-10-18T08:39:20Z" user="jun_meguro" uid="279283" lat="37.4792357" lon="139.9141669"/>
+ <node id="4235793561" visible="true" version="1" changeset="39933437" timestamp="2016-06-10T15:59:25Z" user="jun_meguro" uid="279283" lat="37.4796203" lon="139.9161051">
+ <tag k="name" v="アーティストハウス"/>
+ <tag k="shop" v="variety_store"/>
+ </node>
+ <node id="4235793567" visible="true" version="1" changeset="39933437" timestamp="2016-06-10T15:59:25Z" user="jun_meguro" uid="279283" lat="37.4701581" lon="139.9161869"/>
+ <node id="4235793568" visible="true" version="1" changeset="39933437" timestamp="2016-06-10T15:59:25Z" user="jun_meguro" uid="279283" lat="37.4701637" lon="139.9162140"/>
+ <node id="4235793569" visible="true" version="1" changeset="39933437" timestamp="2016-06-10T15:59:25Z" user="jun_meguro" uid="279283" lat="37.4701684" lon="139.9162316"/>
+ <node id="4235793571" visible="true" version="1" changeset="39933437" timestamp="2016-06-10T15:59:25Z" user="jun_meguro" uid="279283" lat="37.4701833" lon="139.9162564"/>
+ <node id="4235793573" visible="true" version="1" changeset="39933437" timestamp="2016-06-10T15:59:25Z" user="jun_meguro" uid="279283" lat="37.4702067" lon="139.9162788"/>
+ <node id="4235793575" visible="true" version="1" changeset="39933437" timestamp="2016-06-10T15:59:25Z" user="jun_meguro" uid="279283" lat="37.4702282" lon="139.9162929"/>
+ <node id="4235793576" visible="true" version="1" changeset="39933437" timestamp="2016-06-10T15:59:25Z" user="jun_meguro" uid="279283" lat="37.4702637" lon="139.9162976"/>
+ <node id="4235793577" visible="true" version="1" changeset="39933437" timestamp="2016-06-10T15:59:25Z" user="jun_meguro" uid="279283" lat="37.4703460" lon="139.9163000"/>
+ <node id="4235793578" visible="true" version="1" changeset="39933437" timestamp="2016-06-10T15:59:25Z" user="jun_meguro" uid="279283" lat="37.4705470" lon="139.9162976"/>
+ <node id="4235793580" visible="true" version="1" changeset="39933437" timestamp="2016-06-10T15:59:25Z" user="jun_meguro" uid="279283" lat="37.4712414" lon="139.9163094"/>
+ <node id="4235793582" visible="true" version="1" changeset="39933437" timestamp="2016-06-10T15:59:26Z" user="jun_meguro" uid="279283" lat="37.4721138" lon="139.9163047"/>
+ <node id="4235793588" visible="true" version="1" changeset="39933437" timestamp="2016-06-10T15:59:26Z" user="jun_meguro" uid="279283" lat="37.4756994" lon="139.9162879"/>
+ <node id="4235795990" visible="true" version="1" changeset="39933437" timestamp="2016-06-10T15:59:26Z" user="jun_meguro" uid="279283" lat="37.4760347" lon="139.9162916"/>
+ <node id="4235795992" visible="true" version="1" changeset="39933437" timestamp="2016-06-10T15:59:26Z" user="jun_meguro" uid="279283" lat="37.4765378" lon="139.9162920"/>
+ <node id="4235795994" visible="true" version="1" changeset="39933437" timestamp="2016-06-10T15:59:26Z" user="jun_meguro" uid="279283" lat="37.4769583" lon="139.9162836"/>
+ <node id="4235795996" visible="true" version="1" changeset="39933437" timestamp="2016-06-10T15:59:26Z" user="jun_meguro" uid="279283" lat="37.4774011" lon="139.9162629"/>
+ <node id="4235796011" visible="true" version="1" changeset="39933437" timestamp="2016-06-10T15:59:26Z" user="jun_meguro" uid="279283" lat="37.4779859" lon="139.9162473"/>
+ <node id="4235796054" visible="true" version="1" changeset="39933437" timestamp="2016-06-10T15:59:27Z" user="jun_meguro" uid="279283" lat="37.4785655" lon="139.9162711"/>
+ <node id="4235796117" visible="true" version="1" changeset="39933437" timestamp="2016-06-10T15:59:28Z" user="jun_meguro" uid="279283" lat="37.4790400" lon="139.9162695"/>
+ <node id="4235796123" visible="true" version="1" changeset="39933437" timestamp="2016-06-10T15:59:28Z" user="jun_meguro" uid="279283" lat="37.4790592" lon="139.9162671"/>
+ <node id="4235796125" visible="true" version="1" changeset="39933437" timestamp="2016-06-10T15:59:28Z" user="jun_meguro" uid="279283" lat="37.4790721" lon="139.9162630"/>
+ <node id="4235796128" visible="true" version="1" changeset="39933437" timestamp="2016-06-10T15:59:28Z" user="jun_meguro" uid="279283" lat="37.4790836" lon="139.9162533"/>
+ <node id="4235796131" visible="true" version="1" changeset="39933437" timestamp="2016-06-10T15:59:28Z" user="jun_meguro" uid="279283" lat="37.4790964" lon="139.9162339"/>
+ <node id="4235796133" visible="true" version="1" changeset="39933437" timestamp="2016-06-10T15:59:28Z" user="jun_meguro" uid="279283" lat="37.4791003" lon="139.9162178"/>
+ <node id="4235796134" visible="true" version="1" changeset="39933437" timestamp="2016-06-10T15:59:28Z" user="jun_meguro" uid="279283" lat="37.4791016" lon="139.9161919"/>
+ <node id="4235796142" visible="true" version="1" changeset="39933437" timestamp="2016-06-10T15:59:28Z" user="jun_meguro" uid="279283" lat="37.4791481" lon="139.9161887"/>
+ <node id="4235796158" visible="true" version="1" changeset="39933437" timestamp="2016-06-10T15:59:28Z" user="jun_meguro" uid="279283" lat="37.4791864" lon="139.9161860">
+ <tag k="highway" v="crossing"/>
+ </node>
+ <node id="4235796176" visible="true" version="1" changeset="39933437" timestamp="2016-06-10T15:59:29Z" user="jun_meguro" uid="279283" lat="37.4792793" lon="139.9161796">
+ <tag k="highway" v="crossing"/>
+ </node>
+ <node id="4235796191" visible="true" version="1" changeset="39933437" timestamp="2016-06-10T15:59:29Z" user="jun_meguro" uid="279283" lat="37.4793168" lon="139.9161770"/>
+ <node id="4235796205" visible="true" version="1" changeset="39933437" timestamp="2016-06-10T15:59:29Z" user="jun_meguro" uid="279283" lat="37.4793888" lon="139.9161711"/>
+ <node id="4235796209" visible="true" version="1" changeset="39933437" timestamp="2016-06-10T15:59:29Z" user="jun_meguro" uid="279283" lat="37.4794017" lon="139.9162131"/>
+ <node id="4235796211" visible="true" version="1" changeset="39933437" timestamp="2016-06-10T15:59:29Z" user="jun_meguro" uid="279283" lat="37.4794100" lon="139.9162293"/>
+ <node id="4235796213" visible="true" version="1" changeset="39933437" timestamp="2016-06-10T15:59:29Z" user="jun_meguro" uid="279283" lat="37.4794209" lon="139.9162463"/>
+ <node id="4235796221" visible="true" version="1" changeset="39933437" timestamp="2016-06-10T15:59:29Z" user="jun_meguro" uid="279283" lat="37.4794485" lon="139.9162576"/>
+ <node id="4235796227" visible="true" version="1" changeset="39933437" timestamp="2016-06-10T15:59:29Z" user="jun_meguro" uid="279283" lat="37.4797165" lon="139.9162592"/>
+ <node id="4235796236" visible="true" version="1" changeset="39933437" timestamp="2016-06-10T15:59:29Z" user="jun_meguro" uid="279283" lat="37.4801090" lon="139.9162665"/>
+ <node id="4235796347" visible="true" version="1" changeset="39933437" timestamp="2016-06-10T15:59:31Z" user="jun_meguro" uid="279283" lat="37.4795493" lon="139.9161108">
+ <tag k="amenity" v="restaurant"/>
+ <tag k="cuisine" v="chinese"/>
+ <tag k="name" v="大龍軒"/>
+ </node>
+ <node id="4235796350" visible="true" version="1" changeset="39933437" timestamp="2016-06-10T15:59:31Z" user="jun_meguro" uid="279283" lat="37.4796932" lon="139.9160989">
+ <tag k="amenity" v="restaurant"/>
+ <tag k="cuisine" v="chinese"/>
+ <tag k="name" v="鈴木飯店"/>
+ </node>
+ <node id="5252454385" visible="true" version="1" changeset="54155492" timestamp="2017-11-28T17:52:34Z" user="jun_meguro" uid="279283" lat="37.4778775" lon="139.9162502"/>
+ <node id="6086973524" visible="true" version="1" changeset="64836723" timestamp="2018-11-24T05:02:55Z" user="jun_meguro" uid="279283" lat="37.4792738" lon="139.9147579"/>
+ <way id="60521477" visible="true" version="7" changeset="64836723" timestamp="2018-11-24T05:02:55Z" user="jun_meguro" uid="279283">
+ <nd ref="3136449574"/>
+ <nd ref="3136449575"/>
+ <nd ref="2342696889"/>
+ <nd ref="6086973524"/>
+ <nd ref="761578574"/>
+ <nd ref="755713171"/>
+ <nd ref="2308855735"/>
+ <nd ref="2308855711"/>
+ <tag k="highway" v="unclassified"/>
+ </way>
+ <way id="60839396" visible="true" version="1" changeset="4877772" timestamp="2010-06-01T19:36:13Z" user="jun_meguro" uid="279283">
+ <nd ref="761578574"/>
+ <nd ref="761578575"/>
+ <nd ref="761578576"/>
+ <tag k="highway" v="unclassified"/>
+ </way>
+ <way id="225498209" visible="true" version="1" changeset="16530860" timestamp="2013-06-12T22:41:35Z" user="jun_meguro" uid="279283">
+ <nd ref="2342697041"/>
+ <nd ref="2342697034"/>
+ <tag k="highway" v="residential"/>
+ <tag k="source" v="GSI/KIBAN 2500; NARO"/>
+ </way>
+ <way id="225581287" visible="true" version="1" changeset="16539371" timestamp="2013-06-13T15:58:33Z" user="jun_meguro" uid="279283">
+ <nd ref="2343446387"/>
+ <nd ref="2343446379"/>
+ <nd ref="2343446378"/>
+ <nd ref="2343446385"/>
+ <nd ref="2343446387"/>
+ <tag k="building" v="residential"/>
+ </way>
+ <way id="225581303" visible="true" version="1" changeset="16539371" timestamp="2013-06-13T15:58:34Z" user="jun_meguro" uid="279283">
+ <nd ref="2343446372"/>
+ <nd ref="2343446373"/>
+ <nd ref="2343446369"/>
+ <nd ref="2343446366"/>
+ <nd ref="2343446372"/>
+ <tag k="building" v="residential"/>
+ </way>
+ <way id="225581308" visible="true" version="1" changeset="16539371" timestamp="2013-06-13T15:58:34Z" user="jun_meguro" uid="279283">
+ <nd ref="2343446390"/>
+ <nd ref="2343446391"/>
+ <nd ref="2343446389"/>
+ <nd ref="2343446388"/>
+ <nd ref="2343446390"/>
+ <tag k="building" v="residential"/>
+ </way>
+ <way id="225581312" visible="true" version="1" changeset="16539371" timestamp="2013-06-13T15:58:34Z" user="jun_meguro" uid="279283">
+ <nd ref="2343446384"/>
+ <nd ref="2343446386"/>
+ <nd ref="2343446383"/>
+ <nd ref="2343446382"/>
+ <nd ref="2343446384"/>
+ <tag k="building" v="residential"/>
+ </way>
+ <way id="225581316" visible="true" version="1" changeset="16539371" timestamp="2013-06-13T15:58:34Z" user="jun_meguro" uid="279283">
+ <nd ref="2343446380"/>
+ <nd ref="2343446381"/>
+ <nd ref="2343446376"/>
+ <nd ref="2343446375"/>
+ <nd ref="2343446380"/>
+ <tag k="building" v="residential"/>
+ </way>
+ <way id="225581392" visible="true" version="1" changeset="16539371" timestamp="2013-06-13T15:58:38Z" user="jun_meguro" uid="279283">
+ <nd ref="2343446374"/>
+ <nd ref="2343446377"/>
+ <nd ref="2343446371"/>
+ <nd ref="2343446370"/>
+ <nd ref="2343446368"/>
+ <nd ref="2343446367"/>
+ <nd ref="2343446374"/>
+ <tag k="building" v="residential"/>
+ </way>
+ <way id="424116497" visible="true" version="3" changeset="54155492" timestamp="2017-11-28T17:52:36Z" user="jun_meguro" uid="279283">
+ <nd ref="4235796205"/>
+ <nd ref="2308855735"/>
+ <nd ref="4235796191"/>
+ <nd ref="4235796176"/>
+ <nd ref="4235796158"/>
+ <nd ref="4235796142"/>
+ <nd ref="2308855657"/>
+ <nd ref="4235796134"/>
+ <nd ref="4235796133"/>
+ <nd ref="4235796131"/>
+ <nd ref="4235796128"/>
+ <nd ref="4235796125"/>
+ <nd ref="4235796123"/>
+ <nd ref="4235796117"/>
+ <nd ref="4235796054"/>
+ <nd ref="4235796011"/>
+ <nd ref="5252454385"/>
+ <nd ref="4235795996"/>
+ <nd ref="4235795994"/>
+ <nd ref="4235795992"/>
+ <nd ref="4235795990"/>
+ <nd ref="4235793588"/>
+ <nd ref="4235793582"/>
+ <nd ref="4235793580"/>
+ <nd ref="4235793578"/>
+ <nd ref="4235793577"/>
+ <nd ref="4235793576"/>
+ <nd ref="4235793575"/>
+ <nd ref="4235793573"/>
+ <nd ref="4235793571"/>
+ <nd ref="4235793569"/>
+ <nd ref="4235793568"/>
+ <nd ref="4235793567"/>
+ <tag k="footway" v="sidewalk"/>
+ <tag k="highway" v="footway"/>
+ </way>
+ <way id="424116516" visible="true" version="3" changeset="55053671" timestamp="2017-12-31T09:48:02Z" user="jun_meguro" uid="279283">
+ <nd ref="4235796236"/>
+ <nd ref="4235796227"/>
+ <nd ref="4235796221"/>
+ <nd ref="4235796213"/>
+ <nd ref="4235796211"/>
+ <nd ref="4235796209"/>
+ <nd ref="4235796205"/>
+ <tag k="footway" v="sidewalk"/>
+ <tag k="highway" v="footway"/>
+ <tag k="tactile_paving" v="yes"/>
+ <tag k="width" v="2.6"/>
+ </way>
+</osm>
diff --git a/test/xml/parse-only/rss/input.xml b/test/xml/parse-only/rss/input.xml
new file mode 100644
index 0000000..172377c
--- /dev/null
+++ b/test/xml/parse-only/rss/input.xml
@@ -0,0 +1,67 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<rss version="2.0"
+ xmlns:content="http://purl.org/rss/1.0/modules/content/"
+ xmlns:wfw="http://wellformedweb.org/CommentAPI/"
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:atom="http://www.w3.org/2005/Atom"
+ xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
+ xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
+ >
+
+<channel>
+ <title>Roundtrip to Shanghai via Tokyo</title>
+ <atom:link href="http://kohei.us/feed/" rel="self" type="application/rss+xml" />
+ <link>http://kohei.us</link>
+ <description>Kohei Yoshida&#039;s Webspace</description>
+ <lastBuildDate>Wed, 17 Apr 2013 16:48:48 +0000</lastBuildDate>
+ <language>en-US</language>
+ <sy:updatePeriod>hourly</sy:updatePeriod>
+ <sy:updateFrequency>1</sy:updateFrequency>
+ <generator>http://wordpress.org/?v=3.5.1</generator>
+ <item>
+ <title>SUSE Hack Week</title>
+ <link>http://kohei.us/2013/04/17/suse-hack-week/</link>
+ <comments>http://kohei.us/2013/04/17/suse-hack-week/#comments</comments>
+ <pubDate>Wed, 17 Apr 2013 16:48:48 +0000</pubDate>
+ <dc:creator>Kohei Yoshida</dc:creator>
+ <category><![CDATA[]]></category>
+ <category><![CDATA[calc]]></category>
+ <category><![CDATA[excel]]></category>
+ <category><![CDATA[hack week]]></category>
+ <category><![CDATA[orcus]]></category>
+ <category><![CDATA[performance]]></category>
+
+ <guid isPermaLink="false">http://kohei.us/?p=1646</guid>
+ <description><![CDATA[Last week was SUSE&#8217;s Hack Week &#8211; an event my employer does periodically to allow us &#8211; hard working engineers &#8211; to go wild with our wildest ideas and execute them in one week. Just like what I did at my last Hack Week event, I decided to work on integration of Orcus library into LibreOffice once again, to pick up on what I&#8217;d left off from my previous integration work. Integration bits Prior to Hack Week, orcus was already partially integrated; it was used to provide the backend functionality for Calc&#8217;s XML Source feature, and experimental support for Gnumeric file import. The XML Source side was pretty well integrated, [...]]]></description>
+ <content:encoded><![CDATA[<p>Last week was SUSE&#8217;s Hack Week &#8211; an event my employer does periodically to allow us &#8211; hard working engineers &#8211; to go wild with our wildest ideas and execute them in one week. Just like what I did at <a href="2012/08/08/orcus-integration-into-libreoffice/">my last Hack Week event</a>, I decided to work on integration of <a href="https://gitorious.org/orcus">Orcus library</a> into LibreOffice once again, to pick up on what I&#8217;d left off from my previous integration work.</p>
+<h3>Integration bits</h3>
+<p>Prior to Hack Week, orcus was already partially integrated; it was used to provide the backend functionality for <a href="https://wiki.documentfoundation.org/Development/Calc/XMLSource">Calc&#8217;s XML Source feature</a>, and experimental support for Gnumeric file import. The XML Source side was pretty well integrated, but the normal file import side was only partially integrated. Lots of essential pieces were still missing, the largest of which were</p>
+<ul>
+<li>support for multiple filters from a single external filter provider source (such as orcus),</li>
+<li>progress indicator in the status bar, and</li>
+<li>proper type detection by analyzing file content rather than its extension (which we call &#8220;deep detection&#8221;).</li>
+</ul>
+<p>In short, I was able to complete the first two pieces during Hack Week, while the last item still has yet to be worked on. Aside from this, there are still more minor pieces missing, but perhaps I can work on the remaining bits during the next Hack Week.</p>
+<h3>Enabling orcus in your build</h3>
+<p>If you have a recent enough build from the master branch of the LibreOffice repository, you can enable imports via orcus library by</p>
+<ol>
+<li>checking the <strong>Enable experimental features</strong> box in the Options dialog, and</li>
+<li>setting the environment variable <strong>LIBO_USE_ORCUS</strong> to <strong>YES</strong> before launching Calc.</li>
+</ol>
+<p>This will overwrite the stock import filters for ODS, XLSX and CSV. At present, orcus only performs file extension based detection rather than content based one, so be mindful of this when you try this on your machine. To go back to the current import filters, simply disable experimental features, or unset the environment variable.</p>
+<p>Note that I&#8217;ve added this bits to showcase a preview of what orcus can potentially do as a future import filter framework. As such, <em>never use this in production if you want stable file loading experience, or don&#8217;t file bugs against this</em>. We are not ready for that yet. Orcus filters are still missing lots and lots of features.</p>
+<p>Also note that, while in theory you could enable orcus with the Windows build, the performance of orcus on Windows may not be that impressive; in fact, in some cases slower than the current filters. That is because orcus relies on strtod and strtol system calls to convert string numbers into numeric values, and their implementation depend on the platform. And <a href="http://tinodidriksen.com/2011/05/28/cpp-convert-string-to-double-speed/">the performance of MSVC&#8217;s strtod implementation is known to be suboptimal compared to those of gcc and clang on Linux</a>. I&#8217;m very much aware of this, and will work on addressing this at a later time.</p>
+<h3>Performance comparison</h3>
+<p>This is perhaps the most interesting part. I wanted to do a quick performance comparison and see how this orcus filter stands up against the current filter. Given the orcus filter is still only capable of importing raw cell values and not any other features or properties (not even cell formats), I&#8217;ve used <a href="http://cgit.freedesktop.org/libreoffice/contrib/test-files/plain/calc/xlsx-import/perf/8-by-300000-cells.xlsx">this test file which <em>only</em> consists of raw text and numeric values in a 8-by-300000 range</a>, to measure the load times that are as fair and representative as I could make them. Here is the result on my machine running openSUSE 11.4:</p>
+<p><a href="http://kohei.us/wp-content/uploads/2013/04/xlsx-load-times.png"><img src="http://kohei.us/wp-content/uploads/2013/04/xlsx-load-times.png" alt="xlsx-load-times" width="575" height="340" class="alignnone size-full wp-image-1648" /></a></p>
+<p>The current filter, which has undergone its set of performance optimizations on raw cell values, still spends upwards of 50 seconds. Given that it used to take minutes to load this file, it&#8217;s still an improvement.</p>
+<p>The orcus filter, on the other hand, combined with the heavily optimized load handler in Calc core that I put in place during Hack Week, can load the same file in 4.5 seconds. I would say that is pretty impressive.</p>
+<p>I also measured the load time on the same file using Excel 2007, on the same machine running on top of wine, and the result was 7.5 seconds. While running an Windows app via wine emulation layer may incur some performance cost, <a href="http://wiki.winehq.org/Debunking_Wine_Myths#head-7c9ecddfaff60d8891414b68d74277244e7109eb">this page</a> suggests that it should not be noticeable, if any. And my own experience of running various versions of Excel via wine backs up that argument. So this number should be fairly representative of Excel&#8217;s native performance on the same hardware.</p>
+<p>Considering that my ultimate goal with orcus is to beat Excel on performance on loading its own files (or at least not be slower than Excel), I would say we are making good progress toward that goal.</p>
+<p>That&#8217;s all for today. Thank you, ladies and gentlemen.</p>
+]]></content:encoded>
+ <wfw:commentRss>http://kohei.us/2013/04/17/suse-hack-week/feed/</wfw:commentRss>
+ <slash:comments>3</slash:comments>
+ </item>
+ </channel>
+</rss>
diff --git a/test/xml/self-closing-root/check.txt b/test/xml/self-closing-root/check.txt
new file mode 100644
index 0000000..0661686
--- /dev/null
+++ b/test/xml/self-closing-root/check.txt
@@ -0,0 +1 @@
+/foo
diff --git a/test/xml/self-closing-root/input.xml b/test/xml/self-closing-root/input.xml
new file mode 100644
index 0000000..6cb0d72
--- /dev/null
+++ b/test/xml/self-closing-root/input.xml
@@ -0,0 +1 @@
+<foo/><foo/><foo/>
diff --git a/test/xml/simple/check.txt b/test/xml/simple/check.txt
new file mode 100644
index 0000000..a90483e
--- /dev/null
+++ b/test/xml/simple/check.txt
@@ -0,0 +1,12 @@
+/root
+/root/child
+/root/child
+/root/child@attr1="value1"
+/root/child@attr2="value2"
+/root/child
+/root/child/baby
+/root/child/baby"some text"
+/root"before comment|"
+/root"|after comment"
+/root/child
+/root/child@attr3="value3"
diff --git a/test/xml/simple/input.xml b/test/xml/simple/input.xml
new file mode 100644
index 0000000..10ad8fd
--- /dev/null
+++ b/test/xml/simple/input.xml
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- this is a comment -->
+<root>
+ <child/>
+ <child attr2="value2" attr1="value1"/>
+ <child>
+ <baby>some text</baby>
+ </child>
+ before comment|<!-- another comment -->|after comment
+ <child attr3="value3"/>
+ <!-- another comment - with a single hyphen. -->
+</root>
+
diff --git a/test/xml/single-quote/check.txt b/test/xml/single-quote/check.txt
new file mode 100644
index 0000000..b07f0ac
--- /dev/null
+++ b/test/xml/single-quote/check.txt
@@ -0,0 +1,11 @@
+/root
+/root/child
+/root/child@attr1="value1"
+/root/child@attr2="value2"
+/root/child
+/root/child@attr3="\"quoted\""
+/root/child@attr4="before\"after"
+/root/child
+/root/child@attr5=""
+/root/child
+/root/child@attr6="double-quoted"
diff --git a/test/xml/single-quote/input.xml b/test/xml/single-quote/input.xml
new file mode 100644
index 0000000..1cd65db
--- /dev/null
+++ b/test/xml/single-quote/input.xml
@@ -0,0 +1,9 @@
+<?xml version='1.0' encoding='utf-8'?>
+<!-- this is a comment -->
+<root>
+ <child attr2='value2' attr1='value1'/>
+ <child attr3='"quoted"' attr4='before"after'/>
+ <child attr5=''/> <!-- empty attribute value -->
+ <child attr6="double-quoted"/>
+</root>
+
diff --git a/test/xml/underscore-identifier/check.txt b/test/xml/underscore-identifier/check.txt
new file mode 100644
index 0000000..924ade2
--- /dev/null
+++ b/test/xml/underscore-identifier/check.txt
@@ -0,0 +1,5 @@
+/root
+/root/_child
+/root/_child
+/root/_child@_attr2="value2"
+/root/_child@at_tr1="value1"
diff --git a/test/xml/underscore-identifier/input.xml b/test/xml/underscore-identifier/input.xml
new file mode 100644
index 0000000..682514e
--- /dev/null
+++ b/test/xml/underscore-identifier/input.xml
@@ -0,0 +1,4 @@
+<root>
+ <_child/>
+ <_child _attr2="value2" at_tr1="value1"/>
+</root>
diff --git a/test/xml/utf8-1/check.txt b/test/xml/utf8-1/check.txt
new file mode 100644
index 0000000..77b7c00
--- /dev/null
+++ b/test/xml/utf8-1/check.txt
@@ -0,0 +1,4 @@
+/Myšička
+/Myšička@jméno="Žužla"
+/Myšička/Nožičky
+/Myšička/Nožičky"4"
diff --git a/test/xml/utf8-1/input.xml b/test/xml/utf8-1/input.xml
new file mode 100644
index 0000000..c516744
--- /dev/null
+++ b/test/xml/utf8-1/input.xml
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Myšička jméno="Žužla">
+ <Nožičky>4</Nožičky>
+</Myšička>
diff --git a/test/xml/utf8-2/check.txt b/test/xml/utf8-2/check.txt
new file mode 100644
index 0000000..d847aa6
--- /dev/null
+++ b/test/xml/utf8-2/check.txt
@@ -0,0 +1,4 @@
+/ИдОтпр
+/ИдОтпр/ФИООтв
+/ИдОтпр/ФИООтв@Имя="_"
+/ИдОтпр/ФИООтв@Фамилия="_"
diff --git a/test/xml/utf8-2/input.xml b/test/xml/utf8-2/input.xml
new file mode 100644
index 0000000..9e8b294
--- /dev/null
+++ b/test/xml/utf8-2/input.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ИдОтпр>
+ <ФИООтв Фамилия="_" Имя="_"/>
+</ИдОтпр>
+
diff --git a/test/xml/valids/double-boms.xml b/test/xml/valids/double-boms.xml
new file mode 100644
index 0000000..dbb1ebd
--- /dev/null
+++ b/test/xml/valids/double-boms.xml
@@ -0,0 +1 @@
+<?xml version="1.0" ?><root/> \ No newline at end of file