dk.brics.xmlgraph
Class WelldefinedChecker
java.lang.Object
dk.brics.xmlgraph.WelldefinedChecker
public class WelldefinedChecker
- extends Object
Checker for well-definedness of XML graphs.
Definitions:
- A node A top-level-contains a node B if A and B are identical or
B is reachable from A where contents of
ElementNode
s and AttributeNode
s
are ignored.
- A content node is a node that top-level-contains at least one
ElementNode
or TextNode
.
The following properties are checked:
- [interleaved content]
Every node that has a child that top-level contains an
InterleaveNode
content node must
be a SequenceNode
or ElementNode
.
Also, a SequenceNode
that top-level contains
an InterleaveNode
content node must have only one content node child.
- [all nodes productive]
Every node must be productive in the sense that it has at least one unfolding.
Nodes that are not reachable from a root are ignored.
Method Summary |
boolean |
check(XMLGraph xg)
Checks the given XML graph. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
WelldefinedChecker
public WelldefinedChecker(PrintStream err)
- Constructs a new checker.
- Parameters:
err
- print stream for error messages, null if none
check
public boolean check(XMLGraph xg)
- Checks the given XML graph.
- Parameters:
xg
- XML graph
- Returns:
- true if the properties listed above are satisfied
Copyright © 2005-2010 Anders Møller.