summaryrefslogtreecommitdiff
path: root/data
diff options
context:
space:
mode:
Diffstat (limited to 'data')
-rw-r--r--data/examples/interface_definition_sample.xml15
-rw-r--r--data/schemata/interface_definition.rnc16
2 files changed, 8 insertions, 23 deletions
diff --git a/data/examples/interface_definition_sample.xml b/data/examples/interface_definition_sample.xml
index 8b48c20..b74a415 100644
--- a/data/examples/interface_definition_sample.xml
+++ b/data/examples/interface_definition_sample.xml
@@ -1,14 +1,14 @@
<?xml version="1.0"?>
-<interfaceDefinition extends="system">
- <node name="login">
+<interfaceDefinition>
+ <node name="login" owner="login">
<children>
<tagNode name="user">
<properties>
<help>User name</help>
<constraint>
<regex>[a-z][a-zA-Z0-9]+</regex>
- <errorMessage>User name must start with a letter and consist of letters and digits</errorMessage>
</constraint>
+ <constraintErrorMessage>User name must start with a letter and consist of letters and digits</constraintErrorMessage>
</properties>
<children>
<leafNode name="full-name">
@@ -18,15 +18,6 @@
</leafNode>
</children>
</tagNode>
- <leafNode name="hostname">
- <properties>
- <help>System hostname</help>
- <valueHelp>
- <format>text</format>
- <description>System hostname (alphanumeric, must start with a letter)</description>
- </valueHelp>
- </properties>
- </leafNode>
</children>
</node>
</interfaceDefinition>
diff --git a/data/schemata/interface_definition.rnc b/data/schemata/interface_definition.rnc
index a0d6bc1..ffad2af 100644
--- a/data/schemata/interface_definition.rnc
+++ b/data/schemata/interface_definition.rnc
@@ -45,11 +45,12 @@ children = element children
# but whether they are used or not is implementation-defined
properties = element properties
{
- help?,
- constraint?,
+ help? &
+ constraint? &
+ (element constraintErrorMessage { text })? &
# These are meaningful only for leaf nodes
- valueHelp?,
+ valueHelp? &
(multi | valueless)?
}
@@ -80,8 +81,7 @@ ownerAttr = attribute owner
# When multiple constraints are listed, they work as logical OR
constraint = element constraint
{
- (regex | validator)+ &
- errorMessage?
+ (regex | validator)+
}
# A constraint may be a regex pattern
@@ -109,12 +109,6 @@ validatorArgumentAttr = attribute argument
text
}
-# When validation fails, a message can be shown
-errorMessage = element errorMessage
-{
- text
-}
-
# Tag nodes are containers for nodes without predefined names, like network interfaces
# or user names (e.g. "interfaces ethernet eth0" or "user jrandomhacker")
# Tag nodes may contain node and leafNode elements, and also nameConstraint tags