Skip to content

Commit

Permalink
Type attributes: t and type are allowed besides config:type
Browse files Browse the repository at this point in the history
  • Loading branch information
mvidner committed May 6, 2020
1 parent d47c0e8 commit 44874b9
Showing 1 changed file with 15 additions and 6 deletions.
21 changes: 15 additions & 6 deletions src/autoyast-rnc/common.rnc
Original file line number Diff line number Diff line change
@@ -1,21 +1,30 @@
default namespace = "http://www.suse.com/1.0/yast2ns"
namespace config = "http://www.suse.com/1.0/configns"
namespace a = "http://relaxng.org/ns/compatibility/annotations/1.0"
datatypes xsd = "http://www.w3.org/2001/XMLSchema-datatypes"

# Single hash comments # become <!-- XML comments-->
# Double hash comments ## are preserved in .rng as <a:documentation>

## Defined data-types

BOOLEAN =
(
attribute config:type { "boolean" },
## Historically we used config:type
## but it is unnecessarily long to type and read.
## Shorter variants are allowed.
attribute ( t | type | config:type ) { "boolean" },
( "true" | "false" )
)

INTEGER =
(
attribute config:type { "integer" },
attribute ( t | type | config:type ) { "integer" },
xsd:integer
)

# Usage: foo = element foo { STRING_ATTR, ( "bar" | "baz") }
STRING_ATTR = attribute config:type { "string" }?
STRING_ATTR = attribute ( t | type | config:type ) { "string" }?

STRING =
(
Expand All @@ -25,15 +34,15 @@ STRING =

SYMBOL =
(
attribute config:type { "symbol" },
attribute ( t | type | config:type ) { "symbol" },
text
)

LIST =
attribute config:type { "list" }
attribute ( t | type | config:type ) { "list" }

MAP =
attribute config:type { "map" }?
attribute ( t | type | config:type ) { "map" }?

# this is useful for testing
Anything =
Expand Down

0 comments on commit 44874b9

Please sign in to comment.