Skip to content
This repository has been archived by the owner on May 17, 2023. It is now read-only.

Commit

Permalink
Fix schema issue with class-or-set-operator-nested
Browse files Browse the repository at this point in the history
* class-or-set-operator-nested can be a class-invocation, or
  class-declaration, or a set-operator. However, due to both
  class-invocation and class-declaration both having "class" element
  names, it seems that some RelaxNG processor (at least libxml) is having
  trouble validating it.
* so we define a class-invocation-or-declaration production that
  encapsulates the alternate sets of attributes allowed in
  class-invocation and class-declaration, and use it instead.
  • Loading branch information
wil committed Apr 2, 2016
1 parent 5f54cb6 commit 370c1ee
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions lgr-1.0.rnc
Original file line number Diff line number Diff line change
Expand Up @@ -142,15 +142,18 @@ variant = element var {
## (or set-operator like "union") defined elsewhere.
## If used as a matcher (appearing under a "rule" element),
## the "count" attribute may be present.
class-invocation = element class {
class-invocation = element class { class-invocation-content }

class-invocation-content =
attribute by-ref { class-ref },
attribute count { count-pattern }?,
attribute comment { text }?
}

## defines a new class (set of code points) using Unicode property
## or code points of the same tag value or code point literals
class-declaration = element class {
class-declaration = element class { class-declaration-content }

class-declaration-content =
# "name" attribute MUST be present if this is a "top-level"
# class declaration, i.e. appearing directly under the "rules"
# element. Otherwise, it MUST be absent.
Expand All @@ -170,12 +173,16 @@ class-declaration = element class {
# e.g. "0061 0062-0063"
| code-point-set-shorthand
)
}


class-invocation-or-declaration = element class {
class-invocation-content | class-declaration-content
}

class-or-set-operator-nested =
class-invocation | class-declaration | set-operator
class-invocation-or-declaration | set-operator

class-or-set-operator-declaration =
class-or-set-operator-declaration =
# a "class" element or set operator (effectively defining a class)
# directly in the "rules" element.
class-declaration | set-operator
Expand Down

0 comments on commit 370c1ee

Please sign in to comment.