-
Notifications
You must be signed in to change notification settings - Fork 335
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
T5083: extend xml schema definitions to support child requirements
- Loading branch information
1 parent
7925402
commit 38a1913
Showing
10 changed files
with
210 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,27 +2,27 @@ | |
<grammar xmlns="http://relaxng.org/ns/structure/1.0"> | ||
<!-- | ||
interface_definition.rnc: VyConf reference tree XML grammar | ||
Copyright (C) 2014. 2017 VyOS maintainers and contributors <[email protected]> | ||
This library is free software; you can redistribute it and/or | ||
modify it under the terms of the GNU Lesser General Public | ||
License as published by the Free Software Foundation; either | ||
version 2.1 of the License, or (at your option) any later version. | ||
This library is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
Lesser General Public License for more details. | ||
You should have received a copy of the GNU Lesser General Public | ||
License along with this library; if not, write to the Free Software | ||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 | ||
USA | ||
--> | ||
<!-- | ||
The language of this file is compact form RELAX-NG | ||
http://relaxng.org/compact-tutorial-20030326.htm | ||
https://relaxng.org/compact-tutorial-20030326.html | ||
(unless converted to XML, then just RELAX-NG :) | ||
--> | ||
<!-- Interface definition starts with interfaceDefinition tag that may contain node tags --> | ||
|
@@ -142,15 +142,15 @@ | |
Nodes may have properties | ||
For simplicity, any property is allowed in any node, | ||
but whether they are used or not is implementation-defined | ||
Leaf nodes may differ in number of values that can be | ||
associated with them. | ||
By default, a leaf node can have only one value. | ||
"multi" tag means a node can have one or more values, | ||
"valueless" means it can have no values at all. | ||
"hidden" means node visibility can be toggled, eg 'dangerous' commands, | ||
"secret" allows a node to hide its value from unprivileged users. | ||
"priority" is used to influence node processing order for nodes | ||
with exact same dependencies and in compatibility modes. | ||
--> | ||
|
@@ -205,6 +205,10 @@ | |
<text/> | ||
</element> | ||
</optional> | ||
<optional> | ||
<!-- These are meaningful only for tag and node nodes --> | ||
<ref name="childRequirements"/> | ||
</optional> | ||
<optional> | ||
<!-- These are meaningful only for tag nodes --> | ||
<group> | ||
|
@@ -328,4 +332,50 @@ | |
</interleave> | ||
</element> | ||
</define> | ||
<!-- | ||
childRequirements tags is a declarative way to configure basic | ||
requirements of node or tagnode children. | ||
--> | ||
<define name="childRequirements"> | ||
<element name="childRequirements"> | ||
<interleave> | ||
<optional> | ||
<element name="require"> | ||
<oneOrMore> | ||
<ref name="child"/> | ||
</oneOrMore> | ||
</element> | ||
</optional> | ||
<zeroOrMore> | ||
<element name="conflict"> | ||
<ref name="nodeNameAttr"/> | ||
<oneOrMore> | ||
<ref name="child"/> | ||
</oneOrMore> | ||
</element> | ||
</zeroOrMore> | ||
<zeroOrMore> | ||
<element name="atLeastOneOf"> | ||
<oneOrMore> | ||
<ref name="child"/> | ||
</oneOrMore> | ||
</element> | ||
</zeroOrMore> | ||
<zeroOrMore> | ||
<element name="depend"> | ||
<ref name="nodeNameAttr"/> | ||
<oneOrMore> | ||
<ref name="child"/> | ||
</oneOrMore> | ||
</element> | ||
</zeroOrMore> | ||
</interleave> | ||
</element> | ||
</define> | ||
<define name="child"> | ||
<element name="child"> | ||
<ref name="nodeNameAttr"/> | ||
<empty/> | ||
</element> | ||
</define> | ||
</grammar> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.