@c This file is part of the MIT/GNU Scheme Reference Manual.
-@c $Id: io.texi,v 1.11 2005/05/20 02:14:24 cph Exp $
+@c $Id: io.texi,v 1.12 2006/01/30 20:22:41 cph Exp $
@c Copyright 1991,1992,1993,1994,1995 Massachusetts Institute of Technology
@c Copyright 1996,1997,1999,2000,2001 Massachusetts Institute of Technology
-@c Copyright 2002,2003,2004,2005 Massachusetts Institute of Technology
+@c Copyright 2002,2003,2004,2005,2006 Massachusetts Institute of Technology
@c See file scheme.texinfo for copying conditions.
@node Input/Output, Operating-System Interface, Environments, Top
non-associated names with associated names.
@cindex Internationalized Resource Identifier
-@cindex IRI, of XML name
+@cindex URI, of XML name
@cindex qname, of XML name
An @acronym{XML} name consists of two parts: the @dfn{qname}, which is a
symbol, possibly including a namespace prefix; and the
-@dfn{Internationalized Resource Identifier} (@acronym{IRI}), which
+@dfn{Internationalized Resource Identifier} (@acronym{URI}), which
identifies an optional namespace.
-@deffn procedure make-xml-name qname iri
+@deffn procedure make-xml-name qname uri
Creates and returns an @acronym{XML} name. @var{Qname} must be a symbol
-whose name satisfies @code{string-is-xml-name?}. @var{Iri} must be an
-@code{xml-namespace-iri} record. The returned value is an @acronym{XML}
+whose name satisfies @code{string-is-xml-name?}. @var{Uri} must be an
+@code{xml-namespace-uri} record. The returned value is an @acronym{XML}
name that satisfies @code{xml-name?}.
-If @var{iri} is the @dfn{null} namespace (satisfies
+If @var{uri} is the @dfn{null} namespace (satisfies
@code{null-xml-name-prefix?}), the returned value is a symbol equivalent
to @var{qname}. This means that an ordinary symbol can be used as an
@acronym{XML} name when there is no namespace associated with the name.
For convenience, @var{qname} may be a string, in which case it is
converted to a symbol using @code{make-xml-qname}.
-For convenience, @var{iri} may be a string, in which case it is
-converted to an @code{xml-namespace-iri} record using
-@code{make-xml-namespace-iri}.
+For convenience, @var{uri} may be a string, in which case it is
+converted to an @code{xml-namespace-uri} record using
+@code{make-xml-namespace-uri}.
@end deffn
@deffn procedure xml-name? object
Returns the @dfn{qname} of @var{xml-name} as a symbol.
@end deffn
-@deffn procedure xml-name-iri xml-name
-Returns the @dfn{IRI} of @var{xml-name} as an @code{xml-namespace-iri}
+@deffn procedure xml-name-uri xml-name
+Returns the @dfn{URI} of @var{xml-name} as an @code{xml-namespace-uri}
record.
@end deffn
The next procedure compares two @acronym{XML} names for equality. The
rules for equality are slightly complex, in order to permit comparing
names in the @acronym{DTD} with names in the document body. So, if both
-of the names have non-null namespace @acronym{IRI}s, then the names are
+of the names have non-null namespace @acronym{URI}s, then the names are
equal if and only if their local parts are equal and their
-@acronym{IRI}s are equal. (The prefixes of the names are not considered
+@acronym{URI}s are equal. (The prefixes of the names are not considered
in this case.) Otherwise, the names are equal if and only if their
qnames are equal.
@end deffn
These next procedures define the data abstraction for namespace
-@acronym{IRI}s. Conceptually, an @acronym{IRI} is a string with a
+@acronym{URI}s. Conceptually, an @acronym{URI} is a string with a
particular syntax, but this implementation uses an abstract
representation that speeds up type and equality testing. Two
-@acronym{IRI}s are tested for equality using @code{eq?}.
+@acronym{URI}s are tested for equality using @code{eq?}.
-@deffn procedure make-xml-namespace-iri string
-@var{String} must be a syntactically valid @acronym{IRI} encoded in
-@acronym{UTF-8}. Returns the corresponding @acronym{IRI}.
+@deffn procedure make-xml-namespace-uri string
+@var{String} must be a syntactically valid @acronym{URI} encoded in
+@acronym{UTF-8}. Returns the corresponding @acronym{URI}.
@end deffn
-@deffn procedure xml-namespace-iri? object
-Returns @code{#t} if @var{object} is an @acronym{IRI} record, otherwise
+@deffn procedure xml-namespace-uri? object
+Returns @code{#t} if @var{object} is an @acronym{URI} record, otherwise
returns @code{#f}.
@end deffn
-@deffn procedure xml-namespace-iri-string iri
-@var{Iri} must satisfy @code{xml-namespace-iri?}. Returns a newly
-allocated string that is a copy of the string used to create @var{iri}.
+@deffn procedure xml-namespace-uri-string uri
+@var{Uri} must satisfy @code{xml-namespace-uri?}. Returns a newly
+allocated string that is a copy of the string used to create @var{uri}.
@end deffn
-The @acronym{IRI} of an @acronym{XML} name may be null if there is no
-namespace associated with the name. The null @acronym{IRI} is
+The @acronym{URI} of an @acronym{XML} name may be null if there is no
+namespace associated with the name. The null @acronym{URI} is
abstracted by the following two procedures. Note that the null
-@acronym{IRI} satisfies the predicate @code{xml-namespace-iri?}.
+@acronym{URI} satisfies the predicate @code{xml-namespace-uri?}.
-@deffn procedure null-xml-namespace-iri
-Returns the null @acronym{IRI} record.
+@deffn procedure null-xml-namespace-uri
+Returns the null @acronym{URI} record.
@end deffn
-@deffn procedure null-xml-namespace-iri? object
-Returns @code{#t} if @var{object} is the null @acronym{IRI} record,
+@deffn procedure null-xml-namespace-uri? object
+Returns @code{#t} if @var{object} is the null @acronym{URI} record,
otherwise returns @code{#f}.
@end deffn
-The following values are two distinguished @acronym{IRI} records.
+The following values are two distinguished @acronym{URI} records.
-@defvr variable xml-iri
-@code{xml-iri} is the @acronym{IRI} reserved for use by the
-@acronym{XML} recommendation. This @acronym{IRI} must be used with the
+@defvr variable xml-uri
+@code{xml-uri} is the @acronym{URI} reserved for use by the
+@acronym{XML} recommendation. This @acronym{URI} must be used with the
@samp{xml} prefix.
@end defvr
-@defvr variable xmlns-iri
-@code{xmlns-iri} is the @acronym{IRI} reserved for use by the
-@acronym{XML} namespace recommendation. This @acronym{IRI} must be used
+@defvr variable xmlns-uri
+@code{xmlns-uri} is the @acronym{URI} reserved for use by the
+@acronym{XML} namespace recommendation. This @acronym{URI} must be used
with the @samp{xmlns} prefix.
@end defvr
@code{xml-external-id} record.
@end deftp
-@deftp {record type} xml-external-id id iri
+@deftp {record type} xml-external-id id uri
@vindex <xml-external-id>
@findex xml-external-id?
@findex make-xml-external-id
@findex xml-external-id-id
-@findex xml-external-id-iri
+@findex xml-external-id-uri
@findex set-xml-external-id-id!
-@findex set-xml-external-id-iri!
+@findex set-xml-external-id-uri!
The @code{xml-external-id} record is a reference to an external
@acronym{DTD}. This reference consists of two parts: @var{id} is a
public @acronym{ID} literal, corresponding to the @samp{PUBLIC}
-keyword, while @var{iri} is a system literal, corresponding to the
+keyword, while @var{uri} is a system literal, corresponding to the
@samp{SYSTEM} keyword. Either or both may be present, depending on
the context. Each is represented as a string.
@end deftp
#| -*-Scheme-*-
-$Id: xdoc.scm,v 1.2 2004/11/26 15:17:27 cph Exp $
+$Id: xdoc.scm,v 1.3 2006/01/30 20:23:05 cph Exp $
-Copyright 2003,2004 Massachusetts Institute of Technology
+Copyright 2003,2004,2006 Massachusetts Institute of Technology
This file is part of MIT/GNU Scheme.
(define (generate-xdoc-html root)
(if (not (xd:xdoc? root))
(error "Top level element must be <xd:xdoc>:" root))
- (html:html (xdoc-attributes root 'xmlns html-iri)
+ (html:html (xdoc-attributes root 'xmlns html-uri)
"\n"
(html:head #f
"\n "
(xml-name=? name 'style)
(and (xml-name-prefix=? name 'xmlns)
(not (string=? (xml-attribute-value attr)
- (xml-namespace-iri-string xdoc-iri)))))))
+ (xml-namespace-uri-string xdoc-uri)))))))
(define (merged-attribute? attr)
(let ((name (xml-attribute-name attr)))
\f
;;;; XDOC element data types
-(define xdoc-iri
- (make-xml-namespace-iri "http://mit.edu/2003/XDOC"))
+(define xdoc-uri
+ (make-xml-namespace-uri "http://mit.edu/2003/XDOC"))
(define (xdoc-name? name)
- (xml-name-iri=? name xdoc-iri))
+ (xml-name-uri=? name xdoc-uri))
(define (xdoc-name=? name local)
(and (xdoc-name? name)
(let ((qname (symbol-append 'xd: local)))
`(BEGIN
(DEFINE ,qname
- (STANDARD-XML-ELEMENT-CONSTRUCTOR ',qname XDOC-IRI
+ (STANDARD-XML-ELEMENT-CONSTRUCTOR ',qname XDOC-URI
,(eq? content-type 'empty)))
(DEFINE ,(symbol-append qname '?)
- (LET ((NAME (MAKE-XML-NAME ',qname XDOC-IRI)))
+ (LET ((NAME (MAKE-XML-NAME ',qname XDOC-URI)))
(LAMBDA (OBJECT)
(AND (XML-ELEMENT? OBJECT)
(XML-NAME=? (XML-ELEMENT-NAME OBJECT) NAME)))))
#| -*-Scheme-*-
-$Id: xhtml.scm,v 1.19 2006/01/28 02:50:42 cph Exp $
+$Id: xhtml.scm,v 1.20 2006/01/30 20:20:40 cph Exp $
Copyright 2002,2003,2004,2005,2006 Massachusetts Institute of Technology
(declare (usual-integrations))
\f
-(define html-iri-string "http://www.w3.org/1999/xhtml")
-(define html-iri (make-xml-namespace-iri html-iri-string))
+(define html-uri-string "http://www.w3.org/1999/xhtml")
+(define html-uri (make-xml-namespace-uri html-uri-string))
(define (html-element? object)
(and (xml-element? object)
- (xml-name-iri=? (xml-element-name object) html-iri)))
+ (xml-name-uri=? (xml-element-name object) html-uri)))
(define (guarantee-html-element object caller)
(if (not (html-element? object))
(define (html-element-name? object)
(and (xml-name? object)
- (xml-name-iri=? object html-iri)))
+ (xml-name-uri=? object html-uri)))
(define (guarantee-html-element-name object caller)
(if (not (html-element-name? object))
(append-map! (lambda (style)
(list style "\n"))
styles))
- (html:html (xml-attrs 'xmlns html-iri
+ (html:html (xml-attrs 'xmlns html-uri
attrs)
items)
'("\n")))))
(empty? (pair? (cdddr form))))
`(BEGIN
(DEFINE ,(symbol-append 'HTML: name)
- (STANDARD-XML-ELEMENT-CONSTRUCTOR ',name HTML-IRI ,empty?))
+ (STANDARD-XML-ELEMENT-CONSTRUCTOR ',name HTML-URI ,empty?))
(DEFINE ,(symbol-append 'HTML: name '?)
- (STANDARD-XML-ELEMENT-PREDICATE ',name HTML-IRI))
+ (STANDARD-XML-ELEMENT-PREDICATE ',name HTML-URI))
(DEFINE-HTML-ELEMENT-CONTEXT ',name ',context)))
(ill-formed-syntax form)))))
(define (define-html-element-context qname context)
(hash-table/put! element-context-map
- (make-xml-name qname html-iri)
+ (make-xml-name qname html-uri)
context)
qname)
(define-html-element ul block)
(define-html-element var inline)
\f
-(define (html:href iri . contents)
+(define (html:href uri . contents)
(apply html:a
- (xml-attrs 'href iri)
+ (xml-attrs 'href uri)
contents))
(define (html:id-def tag . contents)
(define (html:id-ref tag . contents)
(apply html:href (string-append "#" tag) contents))
-(define (html:rel-link rel iri)
+(define (html:rel-link rel uri)
(html:link 'rel rel
- 'href iri))
+ 'href uri))
-(define (html:style-link iri)
+(define (html:style-link uri)
(html:link 'rel "stylesheet"
- 'href iri
+ 'href uri
'type "text/css"))
(define (html:http-equiv name value)
#| -*-Scheme-*-
-$Id: xml-names.scm,v 1.9 2005/12/13 15:30:28 cph Exp $
+$Id: xml-names.scm,v 1.10 2006/01/30 20:20:42 cph Exp $
-Copyright 2003,2004,2005 Massachusetts Institute of Technology
+Copyright 2003,2004,2005,2006 Massachusetts Institute of Technology
This file is part of MIT/GNU Scheme.
(declare (usual-integrations))
\f
-(define (make-xml-name qname iri)
+(define (make-xml-name qname uri)
(let ((qname (make-xml-qname qname))
- (iri (make-xml-namespace-iri iri)))
- (if (null-xml-namespace-iri? iri)
+ (uri (make-xml-namespace-uri uri)))
+ (if (null-xml-namespace-uri? uri)
qname
(begin
- (check-prefix+iri qname iri)
- (%make-xml-name qname iri)))))
+ (check-prefix+uri qname uri)
+ (%make-xml-name qname uri)))))
-(define (check-prefix+iri qname iri)
+(define (check-prefix+uri qname uri)
(if (let ((s (symbol-name qname)))
(let ((c (find-prefix-separator s)))
(case c
((#f) #f)
- ((ILLEGAL) iri)
+ ((ILLEGAL) uri)
(else
(let ((prefix (utf8-string->symbol (string-head s c))))
(or (and (eq? prefix 'xml)
- (not (eq? iri xml-iri)))
+ (not (eq? uri xml-uri)))
(and (eq? prefix 'xmlns)
- (not (eq? iri xmlns-iri)))))))))
- (error:bad-range-argument iri 'MAKE-XML-NAME)))
+ (not (eq? uri xmlns-uri)))))))))
+ (error:bad-range-argument uri 'MAKE-XML-NAME)))
-(define (%make-xml-name qname iri)
+(define (%make-xml-name qname uri)
(let ((uname
(let ((local (xml-qname-local qname)))
(hash-table/intern! (hash-table/intern! expanded-names
- iri
+ uri
make-eq-hash-table)
local
(lambda ()
- (make-expanded-name iri
+ (make-expanded-name uri
local
(make-eq-hash-table)))))))
(hash-table/intern! (expanded-name-combos uname)
(define (xml-name-qname=? name qname)
(eq? (xml-name-qname name) qname))
-(define (xml-name-iri name)
- (cond ((xml-qname? name) (null-xml-namespace-iri))
- ((combo-name? name) (expanded-name-iri (combo-name-expanded name)))
- (else (error:not-xml-name name 'XML-NAME-IRI))))
+(define (xml-name-uri name)
+ (cond ((xml-qname? name) (null-xml-namespace-uri))
+ ((combo-name? name) (expanded-name-uri (combo-name-expanded name)))
+ (else (error:not-xml-name name 'XML-NAME-URI))))
-(define (xml-name-iri=? name iri)
- (eq? (xml-name-iri name) iri))
+(define (xml-name-uri=? name uri)
+ (eq? (xml-name-uri name) uri))
(define (xml-name-prefix name)
(xml-qname-prefix
(write (combo-name-qname name) port))))
(define-record-type <expanded-name>
- (make-expanded-name iri local combos)
+ (make-expanded-name uri local combos)
expanded-name?
- (iri expanded-name-iri)
+ (uri expanded-name-uri)
(local expanded-name-local)
(combos expanded-name-combos))
\f
-;;;; Namespace IRI
+;;;; Namespace URI
-(define (make-xml-namespace-iri object)
+(define (make-xml-namespace-uri object)
(if (string? object)
(begin
- (if (not (string-is-namespace-iri? object))
- (error:bad-range-argument object 'MAKE-XML-NAMESPACE-IRI))
- (hash-table/intern! namespace-iris object
+ (if (not (string-is-namespace-uri? object))
+ (error:bad-range-argument object 'MAKE-XML-NAMESPACE-URI))
+ (hash-table/intern! namespace-uris object
(lambda ()
- (%make-xml-namespace-iri object))))
+ (%make-xml-namespace-uri object))))
(begin
- (guarantee-xml-namespace-iri object 'MAKE-XML-NAMESPACE-IRI)
+ (guarantee-xml-namespace-uri object 'MAKE-XML-NAMESPACE-URI)
object)))
-(define (string-is-namespace-iri? object)
+(define (string-is-namespace-uri? object)
;; See RFC 1630 for correct syntax.
(utf8-string-valid? object))
-(define namespace-iris
+(define namespace-uris
(make-string-hash-table))
-(define-record-type <xml-namespace-iri>
- (%make-xml-namespace-iri string)
- xml-namespace-iri?
- (string %xml-namespace-iri-string))
+(define-record-type <xml-namespace-uri>
+ (%make-xml-namespace-uri string)
+ xml-namespace-uri?
+ (string %xml-namespace-uri-string))
-(define (guarantee-xml-namespace-iri object caller)
- (if (not (xml-namespace-iri? object))
- (error:not-xml-namespace-iri object caller)))
+(define (guarantee-xml-namespace-uri object caller)
+ (if (not (xml-namespace-uri? object))
+ (error:not-xml-namespace-uri object caller)))
-(define (xml-namespace-iri-string iri)
- (string-copy (%xml-namespace-iri-string iri)))
+(define (xml-namespace-uri-string uri)
+ (string-copy (%xml-namespace-uri-string uri)))
-(define (null-xml-namespace-iri? object)
- (eq? object null-namespace-iri))
+(define (null-xml-namespace-uri? object)
+ (eq? object null-namespace-uri))
-(define (null-xml-namespace-iri)
- null-namespace-iri)
+(define (null-xml-namespace-uri)
+ null-namespace-uri)
-(define null-namespace-iri
- (make-xml-namespace-iri ""))
+(define null-namespace-uri
+ (make-xml-namespace-uri ""))
-(define (error:not-xml-namespace-iri object caller)
- (error:wrong-type-argument object "an XML namespace IRI" caller))
+(define (error:not-xml-namespace-uri object caller)
+ (error:wrong-type-argument object "an XML namespace URI" caller))
-(define xml-iri
- (make-xml-namespace-iri "http://www.w3.org/XML/1998/namespace"))
+(define xml-uri
+ (make-xml-namespace-uri "http://www.w3.org/XML/1998/namespace"))
-(define xmlns-iri
- (make-xml-namespace-iri "http://www.w3.org/2000/xmlns/"))
\ No newline at end of file
+(define xmlns-uri
+ (make-xml-namespace-uri "http://www.w3.org/2000/xmlns/"))
\ No newline at end of file
#| -*-Scheme-*-
-$Id: xml-output.scm,v 1.38 2006/01/26 05:53:49 cph Exp $
+$Id: xml-output.scm,v 1.39 2006/01/30 20:20:43 cph Exp $
Copyright 2001,2002,2003,2004,2005 Massachusetts Institute of Technology
(write-indent col ctx)
(emit-string "PUBLIC " ctx)
(quoted-string (xml-external-id-id id))
- (if (xml-external-id-iri id)
+ (if (xml-external-id-uri id)
(begin
(write-indent col ctx)
- (quoted-string (xml-external-id-iri id)))))
+ (quoted-string (xml-external-id-uri id)))))
(begin
(write-indent col ctx)
(emit-string "SYSTEM" ctx)
(emit-string " " ctx)
- (quoted-string (xml-external-id-iri id))))))
+ (quoted-string (xml-external-id-uri id))))))
\f
(define (write-indent col ctx)
(if col
#| -*-Scheme-*-
-$Id: xml-parser.scm,v 1.65 2005/12/13 15:30:39 cph Exp $
+$Id: xml-parser.scm,v 1.66 2006/01/30 20:20:44 cph Exp $
-Copyright 2001,2002,2003,2004,2005 Massachusetts Institute of Technology
+Copyright 2001,2002,2003,2004,2005,2006 Massachusetts Institute of Technology
This file is part of MIT/GNU Scheme.
(tail (loop (cdr attrs))))
(let ((qname (car uname))
(p (cdr uname)))
- (let ((get-iri (lambda () (make-xml-namespace-iri value)))
- (forbidden-iri
- (lambda (iri)
- (perror p "Forbidden namespace IRI" iri))))
- (let ((guarantee-legal-iri
- (lambda (iri)
- (if (or (eq? iri xml-iri)
- (eq? iri xmlns-iri))
- (forbidden-iri iri)))))
+ (let ((get-uri (lambda () (make-xml-namespace-uri value)))
+ (forbidden-uri
+ (lambda (uri)
+ (perror p "Forbidden namespace URI" uri))))
+ (let ((guarantee-legal-uri
+ (lambda (uri)
+ (if (or (eq? uri xml-uri)
+ (eq? uri xmlns-uri))
+ (forbidden-uri uri)))))
(cond ((xml-name=? qname 'xmlns)
- (let ((iri (get-iri)))
- (guarantee-legal-iri iri)
- (cons (cons (null-xml-name-prefix) iri) tail)))
+ (let ((uri (get-uri)))
+ (guarantee-legal-uri uri)
+ (cons (cons (null-xml-name-prefix) uri) tail)))
((xml-name-prefix=? qname 'xmlns)
(if (xml-name=? qname 'xmlns:xmlns)
(perror p "Illegal namespace prefix" qname))
- (let ((iri (get-iri)))
+ (let ((uri (get-uri)))
(if (xml-name=? qname 'xmlns:xml)
- (if (not (eq? iri xml-iri))
- (forbidden-iri iri))
- (guarantee-legal-iri iri))
- (cons (cons (xml-name-local qname) iri) tail)))
+ (if (not (eq? uri xml-uri))
+ (forbidden-uri uri))
+ (guarantee-legal-uri uri))
+ (cons (cons (xml-name-local qname) uri) tail)))
(else tail))))))
*prefix-bindings*)))
unspecific)
(p (cdr uname)))
(if *in-dtd?*
qname
- (let ((iri (lookup-namespace-prefix qname p attribute-name?)))
- (if (null-xml-namespace-iri? iri)
+ (let ((uri (lookup-namespace-prefix qname p attribute-name?)))
+ (if (null-xml-namespace-uri? uri)
qname
- (%make-xml-name qname iri))))))
+ (%make-xml-name qname uri))))))
(define (lookup-namespace-prefix qname p attribute-name?)
(let ((prefix (xml-qname-prefix qname)))
(cond ((eq? prefix 'xmlns)
- xmlns-iri)
+ xmlns-uri)
((eq? prefix 'xml)
- xml-iri)
+ xml-uri)
((and attribute-name?
(null-xml-name-prefix? prefix))
- (null-xml-namespace-iri))
+ (null-xml-namespace-uri))
(else
(let ((entry (assq prefix *prefix-bindings*)))
(if entry
(begin
(if (not (null-xml-name-prefix? prefix))
(perror p "Undeclared XML prefix" prefix))
- (null-xml-namespace-iri))))))))
+ (null-xml-namespace-uri))))))))
\f
;;;; Processing instructions
(define *general-entities*)
(define *entity-expansion-nesting* '())
-(define (make-external-id id iri p)
+(define (make-external-id id uri p)
(if *standalone?*
(perror p "Illegal external reference in standalone document"))
- (make-xml-external-id id iri))
+ (make-xml-external-id id uri))
\f
;;;; Document-type declarations
#| -*-Scheme-*-
-$Id: xml-rpc.scm,v 1.3 2005/03/25 18:43:12 cph Exp $
+$Id: xml-rpc.scm,v 1.4 2006/01/30 20:20:45 cph Exp $
-Copyright 2003,2004,2005 Massachusetts Institute of Technology
+Copyright 2003,2004,2005,2006 Massachusetts Institute of Technology
This file is part of MIT/GNU Scheme.
(define (rpc-elt name empty?)
(let ((make-elt
(standard-xml-element-constructor name
- (null-xml-namespace-iri)
+ (null-xml-namespace-uri)
empty?)))
(if empty?
(lambda ()
#| -*-Scheme-*-
-$Id: xml-struct.scm,v 1.50 2006/01/26 05:44:33 cph Exp $
+$Id: xml-struct.scm,v 1.51 2006/01/30 20:20:46 cph Exp $
Copyright 2001,2002,2003,2004,2005,2006 Massachusetts Institute of Technology
(id (lambda (object)
(or (not object)
(public-id? object))))
- (iri canonicalize
+ (uri canonicalize
(lambda (object)
(and object
(canonicalize-char-data object)))))
(define-xml-printer external-id
(lambda (dtd)
(or (xml-external-id-id dtd)
- (xml-external-id-iri dtd))))
+ (xml-external-id-uri dtd))))
\f
(define (xml-attribute-namespace-decl? attr)
(let ((name (xml-attribute-name attr)))
(keep-matching-items (xml-element-attributes elt)
xml-attribute-namespace-decl?))
-(define (xml-element-namespace-iri elt prefix)
+(define (xml-element-namespace-uri elt prefix)
(let ((value
(find-xml-attr (if (null-xml-name-prefix? prefix)
'xmlns
(symbol-append 'xmlns: prefix))
elt)))
(and value
- (make-xml-namespace-iri value))))
+ (make-xml-namespace-uri value))))
-(define (xml-element-namespace-prefix elt iri)
- (let ((iri (xml-namespace-iri-string iri)))
+(define (xml-element-namespace-prefix elt uri)
+ (let ((uri (xml-namespace-uri-string uri)))
(let ((attr
(find-matching-item (xml-element-attributes elt)
(lambda (attr)
(and (xml-attribute-namespace-decl? attr)
- (string=? (xml-attribute-value attr) iri))))))
+ (string=? (xml-attribute-value attr) uri))))))
(and attr
(let ((name (xml-attribute-name attr)))
(if (xml-name=? name 'xmlns)
(write-char #\" port))
(apply xml-attrs items))))))
-(define (standard-xml-element-constructor qname iri empty?)
- (let ((name (make-xml-name qname iri)))
+(define (standard-xml-element-constructor qname uri empty?)
+ (let ((name (make-xml-name qname uri)))
(if empty?
(lambda items
(make-xml-element name (apply xml-attrs items) '()))
(if (not attrs) '() attrs)
(flatten-xml-element-content items))))))
-(define (standard-xml-element-predicate qname iri)
- (let ((name (make-xml-name qname iri)))
+(define (standard-xml-element-predicate qname uri)
+ (let ((name (make-xml-name qname uri)))
(lambda (object)
(and (xml-element? object)
(xml-name=? (xml-element-name object) name)))))
(cond ((xml-content-item? value) value)
((symbol? value) (symbol-name value))
((number? value) (number->string value))
- ((xml-namespace-iri? value) (xml-namespace-iri-string value))
+ ((xml-namespace-uri? value) (xml-namespace-uri-string value))
((list-of-type? value xml-nmtoken?) (nmtokens->string value))
(else (error:wrong-type-datum value "XML string value"))))
#| -*-Scheme-*-
-$Id: xml.pkg,v 1.61 2006/01/28 02:48:36 cph Exp $
+$Id: xml.pkg,v 1.62 2006/01/30 20:20:41 cph Exp $
Copyright 2001,2002,2003,2004,2005,2006 Massachusetts Institute of Technology
(files "xml-names")
(parent (runtime xml))
(export ()
- <xml-namespace-iri>
+ <xml-namespace-uri>
error:not-xml-name
- error:not-xml-namespace-iri
+ error:not-xml-namespace-uri
error:not-xml-nmtoken
error:not-xml-qname
guarantee-xml-name
- guarantee-xml-namespace-iri
+ guarantee-xml-namespace-uri
guarantee-xml-nmtoken
guarantee-xml-qname
make-xml-name
make-xml-name-hash-table
- make-xml-namespace-iri
+ make-xml-namespace-uri
make-xml-nmtoken
make-xml-qname
null-xml-name-prefix
null-xml-name-prefix?
- null-xml-namespace-iri
- null-xml-namespace-iri?
+ null-xml-namespace-uri
+ null-xml-namespace-uri?
string-is-xml-name?
string-is-xml-nmtoken?
- xml-iri
xml-name-hash
- xml-name-iri
- xml-name-iri=?
xml-name-local
xml-name-local=?
xml-name-prefix
xml-name-qname
xml-name-qname=?
xml-name-string
+ xml-name-uri
+ xml-name-uri=?
xml-name=?
xml-name?
- xml-namespace-iri-string
- xml-namespace-iri?
+ xml-namespace-uri-string
+ xml-namespace-uri?
xml-nmtoken-string
xml-nmtoken?
xml-qname-local
xml-qname-prefix
xml-qname-string
xml-qname?
- xmlns-iri)
+ xml-uri
+ xmlns-uri)
(export (runtime xml)
%make-xml-name
string-composed-of?
set-xml-element-name!
set-xml-entity-ref-name!
set-xml-external-id-id!
- set-xml-external-id-iri!
+ set-xml-external-id-uri!
set-xml-parameter-!entity-name!
set-xml-parameter-!entity-value!
set-xml-parameter-entity-ref-name!
xml-entity-ref-name
xml-entity-ref?
xml-external-id-id
- xml-external-id-iri
+ xml-external-id-uri
xml-external-id?
xml-misc-content-item?
xml-misc-content?
html-element-names
html-element?
html-external-id?
- html-iri
html-public-id?
+ html-uri
html:a
html:a?
html:abbr
#| -*-Scheme-*-
-$Id: xpath.scm,v 1.3 2004/08/12 06:18:44 cph Exp $
+$Id: xpath.scm,v 1.4 2006/01/30 20:20:47 cph Exp $
Copyright 2003,2004 Massachusetts Institute of Technology
(make-xml-name qname (expand-prefix prefix node)))))
(define (expand-prefix prefix node)
- (cond ((eq? prefix 'xml) xml-iri)
- ((eq? prefix 'xmlns) xmlns-iri)
+ (cond ((eq? prefix 'xml) xml-uri)
+ ((eq? prefix 'xmlns) xmlns-uri)
(else
(let loop ((node node))
- (or (xml-element-namespace-iri (node-item node) prefix)
+ (or (xml-element-namespace-uri (node-item node) prefix)
(let ((parent (parent-node node)))
(if (not (element-node? parent))
(error:bad-range-argument prefix 'EXPAND-PREFIX))
(simple-node-test
(lambda (node)
(and (element-node? node)
- (xml-name-iri=? (node-name node) (expand-prefix prefix node))))))
+ (xml-name-uri=? (node-name node) (expand-prefix prefix node))))))
((attribute)
(simple-node-test
(lambda (node)
- (xml-name-iri=? (node-name node)
+ (xml-name-uri=? (node-name node)
(expand-prefix prefix (node-parent node))))))
((namespace) null-node-test)
(else (error:bad-range-argument type 'NODE-TEST:PREFIX:*))))