anchor.diff:       (puri:intern-uri ns-string *qname-ns-registry*))))
   
   (defun ensure-qname-string (ncname registry)
  -  #+NCNAMES (locally (declare (inline ncname-p)))
     (declare (type string ncname)
   	   (type namespace registry)
   	   (values simple-ncname &optional))
  -  (let ((ncname-s (simplify-string ncname))
  -	(table (namespace-local-names-table registry)))
  -    (or (gethash ncname-s table)
  -	(progn
  -	  #+NCNAMES
  -	  (unless (ncname-p ncname)
  -	    (error 'type-error :expected-type 'ncname :datum ncname))
  -	  (setf (gethash ncname-s table) ncname-s)))))
  +  (locally (declare (inline cxml::valid-ncname-p))
  +    (let ((ncname-s (simplify-string ncname))
  +	  (table (namespace-local-names-table registry)))
  +      (or (gethash ncname-s table)
  +	  (progn
  +	    (unless (cxml::valid-ncname-p ncname)
  +	      (error 'type-error :expected-type 'ncname :datum ncname))
  +	    (setf (gethash ncname-s table) ncname-s))))))
   
   #|
   
  
positive.code:     (ensure-prefix *foo* *foo.ex* *r*)
    (values (eq pfx *foo*) ns )
    )
  
  
  (ensure-prefix "bar" *foo.ex* *r*)
  
negative.code: 
  ;;; * Utils for Name Validation
  
  ;; This needs the cxml-ncname-patch.diff onto CXML
  ;; for (fboundp #'cxml::valid-ncname-p) => T
  
  (deftype ncname ()
    ;; FIXME: Compatibility with Closure RUNES - needs to be further
    ;; integrated into this system, for supporting non-UTF lisp
    ;; implementations
    '(and runes:rod (satisfies cxml::valid-ncname-p)))
  
  (deftype simple-ncname ()
    '(and (simple-array runes:rune) ncname))
  
  
  ;;; * Namespace Qualified Names (QNames)
  