Class mozile.rng.Choice
Object
|
+--mozile.rng.Node
|
+--mozile.rng.Choice
- class
mozile.rng.Choice
- extends mozile.rng.Node
Defined in rng.js
Methods inherited from class mozile.rng.Node |
toString, getType, getSchema, getGrammar, getParentNode, getParentElement, getNextSibling, getChildNodes, getChildNode, appendChild, removeChild, getDescendants, mustContain, mayContain, mayHave, reset, resetAll, selfValidateAll
|
mozile.rng.Choice
mozile.rng.Choice()
Represents an RNG "choice" element.
Parameters:
element
- The RNG element to represent.
mustHave
Boolean mustHave(<String> type)
True if the type is "choice" or if all children mustHave the given type.
Parameters:
type
- The type to be matched.
selfValidate
mozile.rng.Validation selfValidate(validation)
Validates this RNG object. Choices must have at least two child elements.
validate
mozile.rng.Validation validate(<Node> node, <mozile.rng.Validation> validation)
Validates the node.
If this allowText is false and this choice contains an mozile.rng.Text child, then the mozile.rng.Text is immediately validated. Afterward any mozile.rng.Text children are ignored when trying to match an element.
For each RNG child object a new mozile.rng.Validation object is created and the node is validated. The first valid result is returned.
Parameters:
node
- The node to be validated.
validation
- The mozile.rng.Validation object for this validation operation.
Documentation generated by
JSDoc on Wed Aug 23 18:45:51 2006