- (unless (member (occurrence-datatype item) (list (string-datatype) (iri-datatype)) :test #'string=)
- (fail :unsupported-occurrence-datatype "Only string and anyURI values are supported." t))
+ (unless (topic-maps.tmdm::absolute-locator-p (occurrence-datatype item))
+ (fail :invalid-occurrence-datatype "Datatype must be an absolute locator."))
+ (when (and (string= (occurrence-datatype item) (integer-datatype))
+ (not (integer-lexical-p (occurrence-value item))))
+ (fail :invalid-integer-value "Occurrence value is not an xsd:integer lexical form."))
+ (when (and (string= (occurrence-datatype item) (decimal-datatype))
+ (not (decimal-lexical-p (occurrence-value item))))
+ (fail :invalid-decimal-value "Occurrence value is not an xsd:decimal lexical form."))
+ ;; CXTM 3.16: these remaining date datatypes need additional canonical
+ ;; lexical rules. Unknown datatypes use Other, without interpretation.
+ (when (member (occurrence-datatype item)
+ '("http://www.w3.org/2001/XMLSchema#date"
+ "http://www.w3.org/2001/XMLSchema#dateTime") :test #'string=)
+ (fail :unsupported-occurrence-datatype "CXTM 3.16 date/dateTime canonicalization is not implemented." t))