summaryrefslogtreecommitdiffstats
path: root/test/xml-mapped
diff options
context:
space:
mode:
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
71 files changed, 1306 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>泣塑胳1</entry>
+ <entry>泣塑胳2</entry>
+ <entry>泣塑胳3</entry>
+ <entry>泣塑胳4</entry>
+ <entry>泣塑胳5</entry>
+ <entry>泣塑胳6</entry>
+ <entry>泣塑胳7</entry>
+ <entry>泣塑胳8</entry>
+ <entry>泣塑胳9</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***号A区10号 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***弄4号18楼 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>