#| -*-Scheme-*-
-$Id: xml-struct.scm,v 1.18 2003/07/30 19:44:05 cph Exp $
+$Id: xml-struct.scm,v 1.19 2003/08/01 03:25:51 cph Exp $
Copyright 2001,2002,2003 Massachusetts Institute of Technology
((combo-name? name) (universal-name-uri (combo-name-universal name)))
(else (error:not-xml-name name 'XML-NAME-URI))))
+(define (xml-name-local name)
+ (cond ((xml-nmtoken? name)
+ (let ((s (symbol-name name)))
+ (let ((c (string-find-next-char s #\:)))
+ (if c
+ (string->symbol (string-tail s (fix:+ c 1)))
+ name))))
+ ((combo-name? name) (universal-name-local (combo-name-universal name)))
+ (else (error:not-xml-name name 'XML-NAME-STRING))))
+
(define (xml-name=? n1 n2)
(let ((lose (lambda (n) (error:not-xml-name n 'XML-NAME=?))))
(cond ((xml-nmtoken? n1)
(else (lose n2))))
(else (lose n1)))))
+(define (xml-name-hash name modulus)
+ (eq-hash-mod (xml-name-local name) modulus))
+
+(define make-xml-name-hash-table
+ (strong-hash-table/constructor xml-name-hash xml-name=? #t))
+
(define (xml-nmtoken? object)
(and (symbol? object)
(string-is-xml-nmtoken? (symbol-name object))))
#| -*-Scheme-*-
-$Id: xml.pkg,v 1.22 2003/07/30 19:43:52 cph Exp $
+$Id: xml.pkg,v 1.23 2003/08/01 03:26:09 cph Exp $
Copyright 2001,2002,2003 Massachusetts Institute of Technology
make-xml-element
make-xml-entity-ref
make-xml-external-id
+ make-xml-name-hash-table
make-xml-parameter-!entity
make-xml-parameter-entity-ref
make-xml-processing-instructions
xml-external-id-uri
xml-external-id?
xml-intern
+ xml-name-hash
+ xml-name-local
xml-name-string
xml-name-uri
xml-name=?