#| -*-Scheme-*-
-$Id: xml-output.scm,v 1.11 2003/01/26 06:35:34 cph Exp $
+$Id: xml-output.scm,v 1.12 2003/02/07 20:01:59 cph Exp $
-Copyright 2001,2002 Massachusetts Institute of Technology
+Copyright 2001,2002,2003 Massachusetts Institute of Technology
This file is part of MIT Scheme.
(lambda (port)
(write-xml xml port))))
+(define (xml->string xml)
+ (with-string-output-port
+ (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.18 2003/01/26 06:35:41 cph Exp $
+$Id: xml-parser.scm,v 1.19 2003/02/07 20:02:14 cph Exp $
-Copyright 2001,2002 Massachusetts Institute of Technology
+Copyright 2001,2002,2003 Massachusetts Institute of Technology
This file is part of MIT Scheme.
(parse-xml-document (input-port->parser-buffer port)
(if (default-object? pi-handlers) '() pi-handlers)))
+(define (string->xml string #!optional pi-handlers)
+ (parse-xml-document (string->parser-buffer string)
+ (if (default-object? pi-handlers) '() pi-handlers)))
+
+(define (substring->xml string start end #!optional pi-handlers)
+ (parse-xml-document (substring->parser-buffer string start end)
+ (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.14 2003/01/30 17:30:25 cph Exp $
+$Id: xml.pkg,v 1.15 2003/02/07 20:01:48 cph Exp $
Copyright 2001,2002,2003 Massachusetts Institute of Technology
char-set:xml-whitespace
parse-xml-document
read-xml
- read-xml-file))
+ read-xml-file
+ string->xml
+ substring->xml))
(define-package (runtime xml output)
(files "xml-output")
(parent (runtime xml))
(export ()
write-xml
- write-xml-file))
\ No newline at end of file
+ write-xml-file
+ xml->string))
\ No newline at end of file