- (when (and (attr node "datatype")
- (not (equal (attr node "datatype") (topic-maps.tmdm:string-datatype))))
- (reject :resource-data-datatype "Only textual xsd:string resourceData is implemented." node 'xtm-unsupported))
- (dolist (child (node-children node))
- (unless (stringp child)
- (if (equal (node-uri child) +namespace+)
- (reject :unexpected-child "resourceData cannot contain XTM markup." child)
- (reject :resource-data-markup "Embedded XML resourceData is outside this subset." child 'xtm-unsupported)))))
+ (let ((datatype (attr node "datatype")))
+ ;; DATATYPE is already an absolute IRI, not content to
+ ;; resolve against the document or percent-normalize.
+ (when datatype
+ (unless (iri-parts-scheme (split-iri datatype))
+ (reject :invalid-resource-data-datatype "resourceData datatype must be an absolute IRI." node))
+ (validate-decoded-reference (unescape-reference datatype node) node)
+ (unless (member datatype (list (topic-maps.tmdm:string-datatype) (topic-maps.tmdm:iri-datatype)) :test #'equal)
+ (reject :resource-data-datatype "Only textual xsd:string and xsd:anyURI resourceData are implemented." node 'xtm-unsupported)))
+ (dolist (child (node-children node))
+ (unless (stringp child)
+ (if (or (equal datatype (topic-maps.tmdm:iri-datatype)) (equal (node-uri child) +namespace+))
+ (reject :unexpected-child
+ (if (equal datatype (topic-maps.tmdm:iri-datatype))
+ "anyURI resourceData cannot contain child elements."
+ "resourceData cannot contain XTM markup.") child)
+ (reject :resource-data-markup "Embedded XML resourceData is outside this subset." child 'xtm-unsupported))))))