On 06/26/2011 03:19 AM, Laine Stump wrote:
domain.rng, network.rng, and interface.rng already use a few of the
same types (or in some cases *should* but don't), and an upcoming code
change will have them sharing even more. To prepare for that, this
patch takes those common data type definitions and moves them into
basictypes.rng.
This may break some rule about the need to RNG files to be autonomous
or something, but I saw that storageencryption.rng is used in this
way, so I figured it must not be completely against the law...
---
docs/schemas/basictypes.rng | 130 +++++++++++++++++++++++++++++++++++++++++++
docs/schemas/domain.rng | 86 +---------------------------
docs/schemas/interface.rng | 71 ++++-------------------
docs/schemas/network.rng | 79 +++++++-------------------
4 files changed, 166 insertions(+), 200 deletions(-)
create mode 100644 docs/schemas/basictypes.rng
On the surface, this seems reasonable; however, it's probably to wait
until after 0.9.3 to actually commit it.
It looks like we could also make a few more files use this common file;
for example, <define name="UUID"> also appears in
{capability,nwfilter,secret,storagevol}.rng.
diff --git a/docs/schemas/basictypes.rng b/docs/schemas/basictypes.rng
new file mode 100644
index 0000000..b3267f5
--- /dev/null
+++ b/docs/schemas/basictypes.rng
@@ -0,0 +1,130 @@
+<?xml version="1.0"?>
+<!-- network-related definitions used in multiple grammars -->
+<grammar
xmlns="http://relaxng.org/ns/structure/1.0"
datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
+
+ <!-- Our unsignedInt doesn"t allow a leading "+" in its lexical form
-->
+ <define name="unsignedInt">
+ <data type="unsignedInt">
+ <param name="pattern">[0-9]+</param>
+ </data>
+ </define>
+
+ <define name="positiveInteger">
+ <data type="positiveInteger">
+ <param name="pattern">[0-9]+</param>
+ </data>
+ </define>
Should this one be excluding 0 via <param
name="minInclusive">1</param>?
ACK to the changes, once we decide on timing.
--
Eric Blake eblake(a)redhat.com +1-801-349-2682
Libvirt virtualization library
http://libvirt.org