;;; -*-Scheme-*-
;;;
-;;; $Id: xml-output.scm,v 1.8 2002/12/09 18:19:04 cph Exp $
+;;; $Id: xml-output.scm,v 1.9 2002/12/15 05:23:10 cph Exp $
;;;
;;; Copyright (c) 2001, 2002 Massachusetts Institute of Technology
;;;
(declare (usual-integrations))
\f
+(define (write-xml-file xml pathname)
+ (call-with-output-file pathname
+ (lambda (port)
+ (write-xml xml port))))
+
(define-generic write-xml (object port))
(define-method write-xml ((document xml-document-rtd) port)
;;; -*-Scheme-*-
;;;
-;;; $Id: xml-parser.scm,v 1.15 2002/12/09 19:03:38 cph Exp $
+;;; $Id: xml-parser.scm,v 1.16 2002/12/15 05:23:19 cph Exp $
;;;
;;; Copyright (c) 2001, 2002 Massachusetts Institute of Technology
;;;
\f
;;;; Top level
+(define (read-xml-file pathname #!optional pi-handlers)
+ (call-with-input-file pathname
+ (lambda (port)
+ (read-xml port (if (default-object? pi-handlers) '() pi-handlers)))))
+
+(define (read-xml port #!optional pi-handlers)
+ (parse-xml-document (input-port->parser-buffer port)
+ (if (default-object? pi-handlers) '() pi-handlers)))
+
(define (parse-xml-document buffer #!optional pi-handlers) ;[1,22]
(if (not (parser-buffer? buffer))
(error:wrong-type-argument buffer "parser buffer" 'PARSE-XML-DOCUMENT))
;;; -*-Scheme-*-
;;;
-;;; $Id: xml.pkg,v 1.11 2002/12/07 04:13:49 cph Exp $
+;;; $Id: xml.pkg,v 1.12 2002/12/15 05:23:03 cph Exp $
;;;
;;; Copyright (c) 2001, 2002 Massachusetts Institute of Technology
;;;
(files "xml-chars" "xml-parser")
(parent (runtime xml))
(export ()
- parse-xml-document))
+ parse-xml-document
+ read-xml
+ read-xml-file))
(define-package (runtime xml output)
(files "xml-output")
(parent (runtime xml))
(export ()
- write-xml))
\ No newline at end of file
+ write-xml
+ write-xml-file))
\ No newline at end of file