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-c484829272cd13a738e35412498e12f2c9a194ac.tar.xz
liborcus-c484829272cd13a738e35412498e12f2c9a194ac.zip
Adding upstream version 0.19.2.upstream/0.19.2upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'test/xml')
-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
36 files changed, 619 insertions, 0 deletions
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