(defun aii-locally-valid-p (aii attdecl)
(let* ((typedef (find-nun (get-property 'type-definition attdecl)))
(valcon (get-property 'valueconstraint attdecl))
(keyword (get-property 'keyword valcon))
(prelex (get-property 'value valcon))
(normlex (get-property 'normalized-value aii)))
(and
(not (eq attdecl nil))
(not (eq typedef nil))
(nv-locally-valid normlex typedef)
(if (eq keyword 'fixed)
(eq (map-to-value normlex typedef)
(map-to-value prelex typedef))))))
(defun aii-validity-assessed-p (aii)
(let ((attdecl (find-attdecl aii))
(typedef (find-nun (get-property 'type-definition attdecl))))
;; aii validity has been assessed iff three things are true:
(and
;; 1 we know an attribute declaration for it
(not (eq attdecl nil))
;; 2 we have tested its local validity and gotten a verdict
;; of true or false (so we wrap the test in this odd 'if')
(if (aii-locally-valid aii attdecl)
t
t)
;; 3 the test was made with a non-nil attribute declaration
;; (already tested) and non-nil type definition.
(not (eq typedef nil)))))
(defun find-attdecl (aii)
(or (find-context-determined-attdecl aii)
(find-qname-resolved-attdecl aii)))
(defun get-property (propname component)
(cdr (assq propname (caddr component))))