namespace eval ::wsdb::types::stock::Code { variable base xsd::integer variable pattern {[0-9]{4}} variable validate ::wsdb::types::stock::Code::validate }
proc ::wsdb::types::stock::Code::validate { value } { variable base variable pattern if {[::wsdb::types::${base}::validate $value] && [regexp $pattern $value]} { return 1 } else { return 0 }}