Clarifying docs and adding test
svn: r13021
This commit is contained in:
parent
f5aa64f90b
commit
9281b6f2b5
|
@ -2,7 +2,8 @@
|
||||||
;; % mzscheme --require test.ss
|
;; % mzscheme --require test.ss
|
||||||
|
|
||||||
(module test mzscheme
|
(module test mzscheme
|
||||||
(require xml/xml)
|
(require xml/xml
|
||||||
|
scheme/port)
|
||||||
|
|
||||||
|
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
@ -66,7 +67,7 @@
|
||||||
;; permissive?
|
;; permissive?
|
||||||
(with-handlers ([exn?
|
(with-handlers ([exn?
|
||||||
(lambda (exn)
|
(lambda (exn)
|
||||||
(regexp-match #rx"Expected content," (exn-message exn)))])
|
(regexp-match #rx"Expected content," (exn-message exn)))])
|
||||||
(report-err "Non-permissive" (xml->xexpr #f) "Exception"))
|
(report-err "Non-permissive" (xml->xexpr #f) "Exception"))
|
||||||
|
|
||||||
(with-handlers ([exn?
|
(with-handlers ([exn?
|
||||||
|
@ -77,6 +78,29 @@
|
||||||
(when tmp
|
(when tmp
|
||||||
(report-err "Permissive" tmp "#f")))))
|
(report-err "Permissive" tmp "#f")))))
|
||||||
|
|
||||||
|
;; doctype
|
||||||
|
(let ()
|
||||||
|
(define source-string #<<END
|
||||||
|
<!DOCTYPE html PUBLIC
|
||||||
|
"-//W3C//DTD XHTML 1.0 Transitional//EN"
|
||||||
|
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||||
|
<html xmlns="http://www.w3.org/1999/xhtml"> </html>
|
||||||
|
END
|
||||||
|
)
|
||||||
|
|
||||||
|
(define source-document
|
||||||
|
(read-xml (open-input-string source-string)))
|
||||||
|
(define result-string
|
||||||
|
(with-output-to-string (lambda () (write-xml source-document))))
|
||||||
|
(define expected-string #<<END
|
||||||
|
<html xmlns="http://www.w3.org/1999/xhtml"> </html>
|
||||||
|
END
|
||||||
|
)
|
||||||
|
(unless (string=? expected-string result-string)
|
||||||
|
(report-err "DOCTYPE dropping"
|
||||||
|
result-string
|
||||||
|
expected-string)))
|
||||||
|
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
;;
|
;;
|
||||||
;; done
|
;; done
|
||||||
|
|
|
@ -23,9 +23,9 @@ generating XML. XML can be represented as an instance of the
|
||||||
@scheme[document] structure type, or as a kind of S-expression that is
|
@scheme[document] structure type, or as a kind of S-expression that is
|
||||||
called an @deftech{X-expression}.
|
called an @deftech{X-expression}.
|
||||||
|
|
||||||
The @schememodname[xml] library does not provides Document Type
|
The @schememodname[xml] library does not provide Document Type
|
||||||
Declaration (DTD) processing, validation, expanding user-defined
|
Declaration (DTD) processing, including preservation of DTDs in read documents, or validation.
|
||||||
entities, or reading user-defined entities in attributes.
|
It also does not expand user-defined entities or read user-defined entities in attributes.
|
||||||
|
|
||||||
@; ----------------------------------------------------------------------
|
@; ----------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user