dk.brics.relaxng
Class RestrictedChecker

java.lang.Object
  extended by dk.brics.relaxng.RestrictedChecker

public class RestrictedChecker
extends Object

Checker for a grammar to represent a Restricted RELAX NG schema.

Definitions:

The following properties are checked:

  1. [single-type grammar] For every element pattern P, any two element patterns that are top-level-contained by the child of P and have non-disjoint name classes must have the same (identical) content.

  2. [attribute context insensitivity] No attribute list pattern can be a choice pattern, except if its branches have disjoint combinations of xsi:type and xsi:nil attribute values (and those attributes must have singleton name classes and singleton values of type QName). Every optional attribute list pattern must have an attribute pattern as child.

  3. [interleaved content] Every pattern that has a child that top-level contains an interleave content pattern must be a group or element pattern. A group pattern that top-level contains an interleave content pattern must have only one content pattern child.
Here, all refs are implicitly treated as the patterns they refer to. For every element and optional pattern that has more than one child pattern, we treat the children as implicitly enclosed by a group pattern. Also, all mixed patterns are implicitly desugared to interleave patterns, so the restrictions also apply to mixed.

It is implicitly assumed that the grammar represents a (general) RELAX NG schema, in particular that the requirements listed in Section 7 of the spec are satisfied.


Constructor Summary
RestrictedChecker(PrintStream err)
          Constructs a new checker.
RestrictedChecker(PrintWriter err)
          Constructs a new checker.
 
Method Summary
 boolean check(Grammar g)
          Checks the given grammar.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RestrictedChecker

public RestrictedChecker(PrintStream err)
Constructs a new checker.

Parameters:
err - print stream (using default character encoding) for error messages, null if none

RestrictedChecker

public RestrictedChecker(PrintWriter err)
Constructs a new checker.

Parameters:
err - print writer for error messages, null if none
Method Detail

check

public boolean check(Grammar g)
Checks the given grammar.

Parameters:
g - schema grammar
Returns:
true if the properties listed above are satisfied


Copyright © 2005-2010 Anders Møller.