in reply to Inheritance in Hash
For example, to instantiate the entry for nonPositiveInteger I call the derivation constructor (dervive()) on the integer object and then add a new restriction (that the value can't be greater than 0):
$BUILTIN{nonPositiveInteger} = $BUILTIN{integer}->derive(name => 'no +nPositiveInteger'); $BUILTIN{nonPositiveInteger}->restrict( maxInclusive => 0 );
You can see this code here: XML::Validator::Schema::SimpleType. I've found this to be an easy to maintain system which has grown smoothly as new types have been added by myself and others. It also makes supporting custom simple-types created by schemas easy.
-sam
|
|---|