(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."))
- ;; CXTM 3.16: these three remaining datatypes need additional canonical
+ (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#decimal"
- "http://www.w3.org/2001/XMLSchema#date"
+ '("http://www.w3.org/2001/XMLSchema#date"
"http://www.w3.org/2001/XMLSchema#dateTime") :test #'string=)
- (fail :unsupported-occurrence-datatype "CXTM 3.16 numeric/date canonicalization is not implemented." t))
+ (fail :unsupported-occurrence-datatype "CXTM 3.16 date/dateTime canonicalization is not implemented." t))
(when (and (string= (occurrence-datatype item) (iri-datatype))
(not (topic-maps.tmdm::absolute-locator-p (occurrence-value item))))
(fail :invalid-occurrence-value "IRI-valued Occurrences must store an absolute locator."))
(normalized-locator (occurrence-value item)))
((string= (occurrence-datatype item) (integer-datatype))
(canonical-integer-lexical-form (occurrence-value item)))
+ ((string= (occurrence-datatype item) (decimal-datatype))
+ (canonical-decimal-lexical-form (occurrence-value item)))
(t (occurrence-value item))) out)
(format out "</value>~%<datatype>")
;; CXTM 3.14: datatype locator is NOT base-normalized.