[libxml2] Remove redefined starts and defines inside include elements
- From: Daniel Veillard <veillard src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libxml2] Remove redefined starts and defines inside include elements
- Date: Thu, 29 Nov 2018 20:17:38 +0000 (UTC)
commit c64d4efb31ce1d1bec430ce2306d0f538250b960
Author: Nikolai Weibull <now disu se>
Date: Sat Oct 13 00:12:12 2018 +0200
Remove redefined starts and defines inside include elements
When including a grammar from another grammar, we need to make sure that any
redefines of starts and includes that that grammar does inside any of its
include elements are also removed.
relaxng.c | 3 +++
result/relaxng/include1_0 | 0
result/relaxng/include1_0.err | 1 +
result/relaxng/include1_err | 1 +
result/relaxng/include1_valid | 0
test/relaxng/include1-0.inc | 12 ++++++++++++
test/relaxng/include1-1.inc | 7 +++++++
test/relaxng/include1.rng | 12 ++++++++++++
test/relaxng/include1_0.xml | 1 +
9 files changed, 37 insertions(+)
---
diff --git a/relaxng.c b/relaxng.c
index 8725444b..ad803e17 100644
--- a/relaxng.c
+++ b/relaxng.c
@@ -1573,6 +1573,9 @@ xmlRelaxNGRemoveRedefine(xmlRelaxNGParserCtxtPtr ctxt,
#endif
}
}
+ if (xmlRelaxNGRemoveRedefine(ctxt, URL, tmp->children, name) == 1) {
+ found = 1;
+ }
}
tmp = tmp2;
}
diff --git a/result/relaxng/include1_0 b/result/relaxng/include1_0
new file mode 100644
index 00000000..e69de29b
diff --git a/result/relaxng/include1_0.err b/result/relaxng/include1_0.err
new file mode 100644
index 00000000..8c13f4c5
--- /dev/null
+++ b/result/relaxng/include1_0.err
@@ -0,0 +1 @@
+./test/relaxng/include1_0.xml validates
diff --git a/result/relaxng/include1_err b/result/relaxng/include1_err
new file mode 100644
index 00000000..ad4850b0
--- /dev/null
+++ b/result/relaxng/include1_err
@@ -0,0 +1 @@
+./test/relaxng/include1.rng validates
diff --git a/result/relaxng/include1_valid b/result/relaxng/include1_valid
new file mode 100644
index 00000000..e69de29b
diff --git a/test/relaxng/include1-0.inc b/test/relaxng/include1-0.inc
new file mode 100644
index 00000000..87c68028
--- /dev/null
+++ b/test/relaxng/include1-0.inc
@@ -0,0 +1,12 @@
+<grammar xmlns="http://relaxng.org/ns/structure/1.0">
+ <include href="include1-1.inc">
+ <start>
+ <notAllowed/>
+ </start>
+ </include>
+ <start combine="choice">
+ <element name="b">
+ <empty/>
+ </element>
+ </start>
+</grammar>
diff --git a/test/relaxng/include1-1.inc b/test/relaxng/include1-1.inc
new file mode 100644
index 00000000..8af51ec0
--- /dev/null
+++ b/test/relaxng/include1-1.inc
@@ -0,0 +1,7 @@
+<grammar xmlns="http://relaxng.org/ns/structure/1.0">
+ <start>
+ <element name="c">
+ <empty/>
+ </element>
+ </start>
+</grammar>
diff --git a/test/relaxng/include1.rng b/test/relaxng/include1.rng
new file mode 100644
index 00000000..c36bff93
--- /dev/null
+++ b/test/relaxng/include1.rng
@@ -0,0 +1,12 @@
+<grammar xmlns="http://relaxng.org/ns/structure/1.0">
+ <include href="include1-0.inc">
+ <start>
+ <notAllowed/>
+ </start>
+ </include>
+ <start combine="choice">
+ <element name="a">
+ <empty/>
+ </element>
+ </start>
+</grammar>
diff --git a/test/relaxng/include1_0.xml b/test/relaxng/include1_0.xml
new file mode 100644
index 00000000..d80a5e27
--- /dev/null
+++ b/test/relaxng/include1_0.xml
@@ -0,0 +1 @@
+<a/>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]