summaryrefslogtreecommitdiffstats
path: root/test/xml-structure
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-structure
parentInitial commit. (diff)
downloadliborcus-upstream/0.19.2.tar.xz
liborcus-upstream/0.19.2.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-structure')
-rw-r--r--test/xml-structure/attribute-1/check.txt7
-rw-r--r--test/xml-structure/attribute-1/input.xml5
-rw-r--r--test/xml-structure/basic-1/check.txt5
-rw-r--r--test/xml-structure/basic-1/input.xml13
-rw-r--r--test/xml-structure/basic-2/check.txt5
-rw-r--r--test/xml-structure/basic-2/input.xml7
-rw-r--r--test/xml-structure/basic-3/check.txt9
-rw-r--r--test/xml-structure/basic-3/input.xml19
-rw-r--r--test/xml-structure/namespace-default/check.txt5
-rw-r--r--test/xml-structure/namespace-default/input.xml6
-rw-r--r--test/xml-structure/nested-repeat-1/check.txt12
-rw-r--r--test/xml-structure/nested-repeat-1/input.xml20
12 files changed, 113 insertions, 0 deletions
diff --git a/test/xml-structure/attribute-1/check.txt b/test/xml-structure/attribute-1/check.txt
new file mode 100644
index 0000000..02bc1cb
--- /dev/null
+++ b/test/xml-structure/attribute-1/check.txt
@@ -0,0 +1,7 @@
+/root
+/root/@version
+/root/@type
+/root/entry[*]
+/root/entry[*]/@attr1
+/root/entry[*]/@attr2
+/root/entry[*]/@attr3
diff --git a/test/xml-structure/attribute-1/input.xml b/test/xml-structure/attribute-1/input.xml
new file mode 100644
index 0000000..fabfeda
--- /dev/null
+++ b/test/xml-structure/attribute-1/input.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0"?>
+<root version="2.1" type="a">
+ <entry attr1="val1" attr2="val2"/>
+ <entry attr2="val2" attr3="foo"/>
+</root>
diff --git a/test/xml-structure/basic-1/check.txt b/test/xml-structure/basic-1/check.txt
new file mode 100644
index 0000000..95e0737
--- /dev/null
+++ b/test/xml-structure/basic-1/check.txt
@@ -0,0 +1,5 @@
+/root
+/root/entry[*]
+/root/entry[*]/name
+/root/entry[*]/id
+
diff --git a/test/xml-structure/basic-1/input.xml b/test/xml-structure/basic-1/input.xml
new file mode 100644
index 0000000..e7c95a9
--- /dev/null
+++ b/test/xml-structure/basic-1/input.xml
@@ -0,0 +1,13 @@
+<?xml version="1.0"?>
+<!--When recurring elements contain inconsistent set of child elements, we assume that such element structurally contain union of all encountered child elements. -->
+<root>
+ <entry>
+ <name>Foo</name>
+ </entry>
+ <entry>
+ <id>12</id>
+ </entry>
+ <entry>
+ <name>Bah</name>
+ </entry>
+</root>
diff --git a/test/xml-structure/basic-2/check.txt b/test/xml-structure/basic-2/check.txt
new file mode 100644
index 0000000..2072ab1
--- /dev/null
+++ b/test/xml-structure/basic-2/check.txt
@@ -0,0 +1,5 @@
+/root
+/root/name
+/root/age
+/root/nickname
+
diff --git a/test/xml-structure/basic-2/input.xml b/test/xml-structure/basic-2/input.xml
new file mode 100644
index 0000000..1466be4
--- /dev/null
+++ b/test/xml-structure/basic-2/input.xml
@@ -0,0 +1,7 @@
+<?xml version="1.0"?>
+<!--This one has no recurring sub-structure at all.-->
+<root>
+ <name>Thomas Anderson</name>
+ <age>unknown</age>
+ <nickname>Neo</nickname>
+</root>
diff --git a/test/xml-structure/basic-3/check.txt b/test/xml-structure/basic-3/check.txt
new file mode 100644
index 0000000..81a05a6
--- /dev/null
+++ b/test/xml-structure/basic-3/check.txt
@@ -0,0 +1,9 @@
+/data
+/data/entries
+/data/entries/entry[*]
+/data/entries/entry[*]/id
+/data/entries/entry[*]/name
+/data/entries/entry[*]/name/first
+/data/entries/entry[*]/name/last
+/data/entries/entry[*]/nickname
+/data/entries/entry[*]/gender
diff --git a/test/xml-structure/basic-3/input.xml b/test/xml-structure/basic-3/input.xml
new file mode 100644
index 0000000..4eee597
--- /dev/null
+++ b/test/xml-structure/basic-3/input.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0"?>
+<data>
+ <entries>
+ <entry>
+ <id>0</id>
+ <name>
+ <first>Thomas</first>
+ <last>Anderson</last>
+ </name>
+ <nickname>Neo</nickname>
+ <gender>male</gender>
+ </entry>
+ <entry>
+ <id>1</id>
+ <nickname>Trinity</nickname>
+ <gender>female</gender>
+ </entry>
+ </entries>
+</data>
diff --git a/test/xml-structure/namespace-default/check.txt b/test/xml-structure/namespace-default/check.txt
new file mode 100644
index 0000000..811b06b
--- /dev/null
+++ b/test/xml-structure/namespace-default/check.txt
@@ -0,0 +1,5 @@
+ns0="http://test.test.org/"
+/ns0:root
+/ns0:root/ns0:entry
+/ns0:root/ns0:entry/ns0:name
+
diff --git a/test/xml-structure/namespace-default/input.xml b/test/xml-structure/namespace-default/input.xml
new file mode 100644
index 0000000..012dd06
--- /dev/null
+++ b/test/xml-structure/namespace-default/input.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0"?>
+<root xmlns="http://test.test.org/">
+ <entry>
+ <name>Foo</name>
+ </entry>
+</root>
diff --git a/test/xml-structure/nested-repeat-1/check.txt b/test/xml-structure/nested-repeat-1/check.txt
new file mode 100644
index 0000000..8d6380e
--- /dev/null
+++ b/test/xml-structure/nested-repeat-1/check.txt
@@ -0,0 +1,12 @@
+/root
+/root/mode
+/root/mode/insert[*]
+/root/mode/insert[*]/command
+/root/mode/insert[*]/command/@name
+/root/mode/remove[*]
+/root/mode/remove[*]/command
+/root/mode/remove[*]/command/@name
+/root/mode/edit
+/root/mode/edit/command
+/root/mode/edit/command/@name
+
diff --git a/test/xml-structure/nested-repeat-1/input.xml b/test/xml-structure/nested-repeat-1/input.xml
new file mode 100644
index 0000000..9f190cc
--- /dev/null
+++ b/test/xml-structure/nested-repeat-1/input.xml
@@ -0,0 +1,20 @@
+<?xml version="1.0"?>
+<root>
+ <mode>
+ <insert>
+ <command name="foo"/>
+ </insert>
+ <remove>
+ <command name="foo"/>
+ </remove>
+ <insert>
+ <command name="baa"/>
+ </insert>
+ <remove>
+ <command name="baa"/>
+ </remove>
+ <edit>
+ <command name="non-repeat"/>
+ </edit>
+ </mode>
+</root>