Re: xml-parse: file position of elements

Joseph Donaldson <[email protected]> Tue, 15 Feb 2022 04:23:54 +0000 (UTC)
Newsgroups gmane.lisp.scheme.bigloo
Message-ID <[email protected]>
------=_Part_2269274_799726553.1644899034192
Content-Type: multipart/alternative; 
	boundary="----=_Part_2269273_182048361.1644899034175"

------=_Part_2269273_182048361.1644899034175
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

 Hello, Sven,
I extended xml-parse so that it takes procedures for creating all of the xm=
l constructs. It makes the parser more flexible and may be useful some use =
cases.
Best Regards,Joe Donaldson

    On Monday, February 14, 2022, 12:13:44 PM PST, Sven Hartrumpf <hartrump=
[email protected]> wrote: =20
=20
 Hello Joe.

donaldsonjw, 2022-02-14 17:04:
> What do you think of changing content-pos to make-content with it being a=
 procedure for constructing a content object. It will take 2 arguments, the=
 content string and the position of the string. The default implementation =
just returns the content string, but one can provide his
> or her own implementation. I also think changing the procedure argument t=
o make-element indicates its purpose better.

I thought about this before :-)
Fits the rest of the code much better.

> I have attached a version of xml.scm with these changes. If providing mak=
e-element and make-content is a good idea perhaps we should also parameteri=
ze xml-parse
> with make-cdata, make-comment, make-declaration, and so on.

I am neutral about these, but I can envision some use cases for these exten=
sions.

Regards
Sven

> Best Regards,
> Joe Donaldson
>
> On Thursday, February 10, 2022, 09:42:43 AM PST, Sven Hartrumpf <hartrump=
[email protected]> wrote:
>
> Hello Joe.
>
> donaldsonjw, 2022-02-06 01:00:
>> Here is another version of xml.scm that I believe addresses the problem =
you pointed out. Let me know how it works for you.
>
> Thanks again.
> I had to fix two calls of 'make' by moving the position to the end, see a=
ttached file,
> then everyting worked like a charm.
>
> To finish my problem solution and test it (successfully) on some thousand=
 nontrivial
> xml files, I had to add a new option content-pos. If true, content string=
s are turned into
> (content-string offset). The changes are backward-compatible because the =
default is content-pos #f.
> The representation (and the name of the option) might not fit the rest, s=
o feel free to change it.
>
> You can open a pull request on bigloo's github soon, I guess.
>
> Greetings
>
> Sven
> ;*=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D*/
> ;*=C2=A0 =C2=A0 serrano/prgm/project/bigloo/bigloo/api/web/src/Llib/xml.s=
cm=C2=A0 =C2=A0 =C2=A0 */
> ;*=C2=A0 =C2=A0 ---------------------------------------------------------=
----=C2=A0 =C2=A0 */
> ;*=C2=A0 =C2=A0 Author=C2=A0 =C2=A0 =C2=A0 :=C2=A0 Manuel Serrano=C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 */
> ;*=C2=A0 =C2=A0 Creation=C2=A0 =C2=A0 :=C2=A0 Fri Mar 11 16:23:53 2005=C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 */
> ;*=C2=A0 =C2=A0 Last change :=C2=A0 Sun Oct=C2=A0 7 08:46:03 2018 (serran=
o)=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 */
> ;*=C2=A0 =C2=A0 Copyright=C2=A0 :=C2=A0 2005-18 Manuel Serrano=C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 */
> ;*=C2=A0 =C2=A0 ---------------------------------------------------------=
----=C2=A0 =C2=A0 */
> ;*=C2=A0 =C2=A0 XML parsing=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 */
> ;*=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D*/
>
> ;*---------------------------------------------------------------------*/
> ;*=C2=A0 =C2=A0 The module=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 */
> ;*---------------------------------------------------------------------*/
> (module __web_xml
>
>=C2=A0 (option (set! *dlopen-init-gc* #t))
>
>=C2=A0 (export (xml-parse::pair-nil port::input-port
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 #!key
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (content-length 0)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (procedure (lambda=
 (tag attribs body start-pos)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 (list tag attribs body)))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (specials '())
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (strict #t)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (content-pos #f)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (encoding 'UTF-8)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (eoi #f))
>=C2=A0 =C2=A0 =C2=A0 (xml-string-decode::bstring ::bstring)
>=C2=A0 =C2=A0 =C2=A0 (xml-string-decode!::bstring ::bstring)
>=C2=A0 =C2=A0 =C2=A0 (xml-string-encode::bstring ::bstring)
>=C2=A0 =C2=A0 =C2=A0 (read-xml #!optional (port::input-port (current-input=
-port)))
>=C2=A0 =C2=A0 =C2=A0 (xml-metadata xml-tree::pair-nil)))
>
> ;*---------------------------------------------------------------------*/
> ;*=C2=A0 =C2=A0 xml-parse ...=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 */
> ;*---------------------------------------------------------------------*/
> (define (xml-parse::pair-nil port::input-port
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 #!key
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (content-length 0)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (procedure (lambda=
 (tag attribs body start-pos)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (=
list tag attribs body)))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 (specials '())
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (strict #t)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 (content-pos #f)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (encoding 'UTF-8)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (eoi #f))
>=C2=A0 (when (elong? content-length)
>=C2=A0 =C2=A0 =C2=A0 (set! content-length (elong->fixnum content-length)))
>=C2=A0 (when (and (fixnum? content-length) (>fx content-length 0))
>=C2=A0 =C2=A0 =C2=A0 (input-port-fill-barrier-set! port content-length))
>=C2=A0 (when (>fx content-length 0)
>=C2=A0 =C2=A0 =C2=A0 (set! content-length (+fx content-length (input-port-=
position port))))
>=C2=A0 (let loop ((decoder (lambda (x) x)))
>=C2=A0 =C2=A0 =C2=A0 (let ((obj (read/rp xml-grammar port procedure proced=
ure specials strict content-pos decoder encoding (input-port-position port)=
)))
>=C2=A0 =C2=A0 (when (and (fixnum? content-length) (>fx content-length 0))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 (input-port-fill-barrier-set! port -1))
>=C2=A0 =C2=A0 (cond
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 ((eof-object? obj)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 '())
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 ((or (and (procedure? eoi) (eoi obj))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 (and (>fx content-length 0)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (>=3Dfx (input-port-posit=
ion port) content-length)))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 (list obj))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 ((and (pair? obj) (eq? 'xml-decl (car obj)))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 (let ((enc (assq 'encoding (cdr obj))))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 (if enc
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (cons obj (loop (get-decoder (cd=
r enc) encoding)))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (cons obj (loop decoder)))))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 (else
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 (cons obj (loop decoder)))))))
>
> ;*---------------------------------------------------------------------*/
> ;*=C2=A0 =C2=A0 xml-parse-error ...=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 */
> ;*---------------------------------------------------------------------*/
> (define (xml-parse-error msg obj name pos)
>=C2=A0 (raise
>=C2=A0 =C2=A0 (instantiate::&io-parse-error
>=C2=A0 =C2=A0 =C2=A0 (proc 'xml-parse)
>=C2=A0 =C2=A0 =C2=A0 (msg msg)
>=C2=A0 =C2=A0 =C2=A0 (obj obj)
>=C2=A0 =C2=A0 =C2=A0 (fname name)
>=C2=A0 =C2=A0 =C2=A0 (location pos))))
>
> ;*---------------------------------------------------------------------*/
> ;*=C2=A0 =C2=A0 error-line ...=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 */
> ;*---------------------------------------------------------------------*/
> (define (error-line c port)
>=C2=A0 (let ((line (read-line port)))
>=C2=A0 =C2=A0 =C2=A0 (string-append "{" (string c) "}" (if (string? line) =
line ""))))
>
> ;*---------------------------------------------------------------------*/
> ;*=C2=A0 =C2=A0 special ...=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 */
> ;*---------------------------------------------------------------------*/
> (define-struct special tag attributes body owner)
>
> ;*---------------------------------------------------------------------*/
> ;*=C2=A0 =C2=A0 collect-up-to ...=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 */
> ;*---------------------------------------------------------------------*/
> (define (collect-up-to start-pos ignore tag attributes port make specials=
 strict content-pos decoder encoding)
>
>=C2=A0 (define (collect ignore tags)
>=C2=A0 =C2=A0 =C2=A0 (let ((name (input-port-name port))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 (po (input-port-position port)))
>=C2=A0 =C2=A0 (let loop ((acc '())
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (item (ignore)))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 (cond
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ((symbol? item)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 (cond
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ((eq? item tag)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (make tag attributes (reverse! a=
cc) start-pos))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (strict
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (xml-parse-error "Illegal closin=
g tag"
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (format "`~a' expected, `=
~a' provided"
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 tag item)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 name po))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (else
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (make tag attributes (reverse! a=
cc) start-pos))))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ((special? item)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 (let ((nitem (make (special-tag item)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (special-attribute=
s item)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (special-body item=
)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 start-pos)))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (if (memq (special-tag item) tags)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (loop acc nitem)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (list (make tag attribute=
s (reverse! acc) start-pos) nitem))))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ((eof-object? item)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 (if strict
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (xml-parse-error
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (format "Premature end of=
 line, expecting tag `~a'"
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 tag)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 item name po)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (make tag attributes (reverse! a=
cc) start-pos)))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (else
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 (let ((po (input-port-last-token-position port=
)))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (loop (econs item acc (list 'at name po=
)) (ignore))))))))
>
>=C2=A0 (let ((spec (assq tag specials)))
>=C2=A0 =C2=A0 =C2=A0 (cond
>=C2=A0 =C2=A0 ((not spec)
>=C2=A0 =C2=A0 =C2=A0 (collect ignore '()))
>=C2=A0 =C2=A0 ((null? (cdr spec))
>=C2=A0 =C2=A0 =C2=A0 (make tag attributes '() start-pos))
>=C2=A0 =C2=A0 ((procedure? (cdr spec))
>=C2=A0 =C2=A0 =C2=A0 (make tag attributes ((cdr spec) port) start-pos))
>=C2=A0 =C2=A0 ((pair? (cdr spec))
>=C2=A0 =C2=A0 =C2=A0 (let ((ignore (lambda ()
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (read/rp xml-grammar port
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (lam=
bda (t a b) (special t a b tag))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 make
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 spec=
ials strict content-pos decoder encoding (input-port-position port)))))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 (collect ignore (cdr spec))))
>=C2=A0 =C2=A0 (else
>=C2=A0 =C2=A0 =C2=A0 (error "xml-parse" "Illegal special handler" spec))))=
)
>
> ;*---------------------------------------------------------------------*/
> ;*=C2=A0 =C2=A0 attribute-value-grammar ...=C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 */
> ;*---------------------------------------------------------------------*/
> (define attribute-value-grammar
>=C2=A0 (regular-grammar (strict tag)
>=C2=A0 =C2=A0 =C2=A0 ((+ (in " \t\n\r"))
>=C2=A0 =C2=A0 =C2=A0 (ignore))
>=C2=A0 =C2=A0 =C2=A0 ((: #\" (* (or (out #\\ #\") (: #\\ all))) #\")
>=C2=A0 =C2=A0 =C2=A0 (the-substring 1 (-fx (the-length) 1)))
>=C2=A0 =C2=A0 =C2=A0 ((: #\' (* (or (out #\\ #\') (: #\\ all))) #\')
>=C2=A0 =C2=A0 =C2=A0 (the-substring 1 (-fx (the-length) 1)))
>=C2=A0 =C2=A0 =C2=A0 ((: (+ digit) (? (or "%" "px" "cm" "em" "mm" "inch"))=
)
>=C2=A0 =C2=A0 =C2=A0 (if strict
>=C2=A0 =C2=A0 =C2=A0 (xml-parse-error (format "Illegal `~a' attribute valu=
e" tag)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (the-string)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (input-port-name (=
the-port))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (input-port-positi=
on (the-port)))
>=C2=A0 =C2=A0 =C2=A0 (the-string)))
>=C2=A0 =C2=A0 =C2=A0 ((+ (out " \t\n\r<>(){}[]@!\"'/"))
>=C2=A0 =C2=A0 =C2=A0 (if strict
>=C2=A0 =C2=A0 =C2=A0 (xml-parse-error (format "Illegal `~a' attribute char=
acter" tag)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (the-string)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (input-port-name (=
the-port))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (input-port-positi=
on (the-port)))
>=C2=A0 =C2=A0 =C2=A0 (the-string)))
>=C2=A0 =C2=A0 =C2=A0 (else
>=C2=A0 =C2=A0 =C2=A0 (let ((c (the-failure)))
>=C2=A0 =C2=A0 =C2=A0 (if (not (eof-object? c))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (if (or strict
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (not (or (char=3D? c #\sp=
ace)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (char=3D? c=
 #\Newline)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (char=3D? c=
 #\>))))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (xml-parse-error
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (format "Illegal `~a' attribute charact=
er" tag)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (error-line c (the-port))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (input-port-name (the-port))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (input-port-position (the-port)))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 " ")
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (xml-parse-error
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (format "Premature end of line for tag =
`~a' attribute" tag)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 c
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (input-port-name (the-port))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (-fx (input-port-position (the-port)) 1=
)))))))
>
> ;*---------------------------------------------------------------------*/
> ;*=C2=A0 =C2=A0 attribute-grammar ...=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 */
> ;*---------------------------------------------------------------------*/
> (define attribute-grammar
>=C2=A0 (regular-grammar ((id (: (in ("azAZ") "_") (* (in ("azAZ09") ":_-")=
)))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 tag
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 strict
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 decoder)
>=C2=A0 =C2=A0 =C2=A0 ((+ (in " \t\n\r"))
>=C2=A0 =C2=A0 =C2=A0 (ignore))
>=C2=A0 =C2=A0 =C2=A0 ((: id "=3D")
>=C2=A0 =C2=A0 =C2=A0 (let* ((key (the-substring 0 (-fx (the-length) 1)))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (val (read/rp attribute-value-grammar (=
the-port) strict tag)))
>=C2=A0 =C2=A0 =C2=A0 (cons (string->symbol (decoder key)) (decoder val))))
>=C2=A0 =C2=A0 =C2=A0 ((: id (+ blank) "=3D")
>=C2=A0 =C2=A0 =C2=A0 (let* ((key (the-substring 0 (-fx (the-length) 2)))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (val (read/rp attribute-value-grammar (=
the-port) strict tag)))
>=C2=A0 =C2=A0 =C2=A0 (let loop ((i (-fx (string-length key) 1)))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 (case (string-ref key i)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 ((#\space #\tab #\Newline)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 (loop (-fx i 1)))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 (else
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 (set! key (substring key 0 (+ i 1))))))
>=C2=A0 =C2=A0 =C2=A0 (cons (string->symbol (decoder key)) (decoder val))))
>=C2=A0 =C2=A0 =C2=A0 ((: id)
>=C2=A0 =C2=A0 =C2=A0 (let* ((key (decoder (the-string))))
>=C2=A0 =C2=A0 =C2=A0 (cons (string->symbol key) key)))
>=C2=A0 =C2=A0 =C2=A0 ((or "/>" ">")
>=C2=A0 =C2=A0 =C2=A0 (the-symbol))
>=C2=A0 =C2=A0 =C2=A0 (else
>=C2=A0 =C2=A0 =C2=A0 (let ((c (the-failure)))
>=C2=A0 =C2=A0 =C2=A0 (if (not (eof-object? c))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (xml-parse-error "Illegal attribute cha=
racter"
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (error-line=
 c (the-port))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (input-port=
-name (the-port))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (input-port=
-position (the-port)))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (xml-parse-error
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (format "Premature end of line, expecti=
ng tag `~a'" tag)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 c
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (input-port-name (the-port))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (-fx (input-port-position (the-port)) 1=
)))))))
>
> ;*---------------------------------------------------------------------*/
> ;*=C2=A0 =C2=A0 cdata-grammar ...=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 */
> ;*---------------------------------------------------------------------*/
> (define cdata-grammar
>=C2=A0 (regular-grammar (decoder)
>=C2=A0 =C2=A0 =C2=A0 ((* (out "]"))
>=C2=A0 =C2=A0 =C2=A0 (let* ((res (decoder (the-string)))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (rest (ignore)))
>=C2=A0 =C2=A0 =C2=A0 (string-append res rest)))
>=C2=A0 =C2=A0 =C2=A0 ("]"
>=C2=A0 =C2=A0 =C2=A0 (string-append "]" (ignore)))
>=C2=A0 =C2=A0 =C2=A0 ((: "]]>" (? "\n"))
>=C2=A0 =C2=A0 =C2=A0 "")
>=C2=A0 =C2=A0 =C2=A0 (else
>=C2=A0 =C2=A0 =C2=A0 (let* ((c (the-failure))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (msg (if (not (eof-object? c))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 "Illegal <![CDATA[ charac=
ter"
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 "Premature end of line, e=
xpecting tag `]]>'")))
>=C2=A0 =C2=A0 =C2=A0 (xml-parse-error msg
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 c
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (input-port-name (the-por=
t))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (input-port-position (the=
-port)))))))
>
> ;*---------------------------------------------------------------------*/
> ;*=C2=A0 =C2=A0 get-decoder ...=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 */
> ;*---------------------------------------------------------------------*/
> (define (get-decoder::procedure enc::bstring dst-enc)
>=C2=A0 (let ((src-enc (string->symbol (string-upcase enc))))
>=C2=A0 =C2=A0 =C2=A0 (cond
>=C2=A0 =C2=A0 ((or (not src-enc) (eq? src-enc dst-enc))
>=C2=A0 =C2=A0 =C2=A0 (lambda (x) x))
>=C2=A0 =C2=A0 ((eq? src-enc 'UTF-8)
>=C2=A0 =C2=A0 =C2=A0 (cond
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 ((memq dst-enc '(ISO-8859-1 ISO-8859-2 ISO-885=
9-15))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 utf8->iso-latin)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 ((eq? dst-enc 'UCS-2)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 utf8-string->ucs2-string)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 (else
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (lambda (x) x))))
>=C2=A0 =C2=A0 ((memq src-enc '(ISO-8859-1 ISO-8859-2 ISO-8859-15))
>=C2=A0 =C2=A0 =C2=A0 (cond
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 ((eq? dst-enc 'UTF-8)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 iso-latin->utf8)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 ((eq? dst-enc 'UCS-2)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (lambda (x)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 (utf8-string->ucs2-string (iso-latin->utf8 x))=
))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 (else
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (lambda (x) x))))
>=C2=A0 =C2=A0 (else
>=C2=A0 =C2=A0 =C2=A0 (lambda (x) x)))))
>
> ;*---------------------------------------------------------------------*/
> ;*=C2=A0 =C2=A0 xml-grammar ...=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 */
> ;*---------------------------------------------------------------------*/
> (define xml-grammar
>=C2=A0 (regular-grammar ((id (: (in ("azAZ") "!?") (* (in ("azAZ09") ":_-"=
))))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 next
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 make
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 specials
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 strict
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 cont=
ent-pos
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 decoder
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 encoding
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 pos)
>
>=C2=A0 =C2=A0 =C2=A0 (define (update-start-position!)
>=C2=A0 =C2=A0 =C2=A0 (set! pos (input-port-position (the-port))))
>
>=C2=A0 =C2=A0 =C2=A0 (define (ignore-w/-pos-update!)
>=C2=A0 =C2=A0 =C2=A0 (update-start-position!)
>=C2=A0 =C2=A0 =C2=A0 (ignore))
>
>=C2=A0 =C2=A0 =C2=A0 ((+ (in " \t\n\r"))
>=C2=A0 =C2=A0 =C2=A0 (update-start-position!)
>=C2=A0 =C2=A0 =C2=A0 (if content-pos
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (list (the-string) (- pos (the-length))=
)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (the-string)))
>=C2=A0 =C2=A0 =C2=A0 ((: "<!--"
>=C2=A0 =C2=A0 =C2=A0 (* (or (out "-") (: "-" (out "-")) (: "--" (out ">"))=
))
>=C2=A0 =C2=A0 =C2=A0 "-->")
>=C2=A0 =C2=A0 =C2=A0 (update-start-position!)
>=C2=A0 =C2=A0 =C2=A0 (cons 'comment (the-string)))
>=C2=A0 =C2=A0 =C2=A0 ((: "<!" (: (or (out "[-") (: "-" (out "-")))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (* (out ">]"))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (? (: "[" (* (out "]")) "]"))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (* (out ">"))) ">")
>=C2=A0 =C2=A0 =C2=A0 (update-start-position!)
>=C2=A0 =C2=A0 =C2=A0 (cons 'declaration (the-string)))
>=C2=A0 =C2=A0 =C2=A0 ("<![CDATA["
>=C2=A0 =C2=A0 =C2=A0 (let ((cdata (read/rp cdata-grammar (the-port) decode=
r)))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (update-start-position!)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (cons 'cdata cdata)))
>=C2=A0 =C2=A0 =C2=A0 ((: "<?xml " (* (out "?>")) "?>")
>=C2=A0 =C2=A0 =C2=A0 (let ((s (the-substring 6 (the-length))))
>=C2=A0 =C2=A0 =C2=A0 (string-set! s (-fx (string-length s) 2) #\space)
>=C2=A0 =C2=A0 =C2=A0 (let ((p (open-input-string s)))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 (let loop ((attr '()))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 (let ((obj (read/rp attribute-grammar p 'xml #=
t decoder)))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (cond
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ((pair? obj)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (loop (cons obj attr)))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ((eq? obj '>)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 (update-start-position!)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (cons 'xml-decl attr)))))=
)))
>=C2=A0 =C2=A0 =C2=A0 ((: "<?" (* (out ">")) ">")
>=C2=A0 =C2=A0 =C2=A0 (update-start-position!)
>=C2=A0 =C2=A0 =C2=A0 (cons 'instruction (the-string)))
>=C2=A0 =C2=A0 =C2=A0 ((: "<" id ">")
>=C2=A0 =C2=A0 =C2=A0 (let* ((t (the-substring 1 (-fx (the-length) 1)))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (ts (string->symbol t))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (p (the-port)))
>=C2=A0 =C2=A0 =C2=A0 (let ((element (collect-up-to pos ignore-w/-pos-updat=
e! ts '() p make specials strict content-pos decoder encoding)))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (update-start-position!)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 element)))
>=C2=A0 =C2=A0 =C2=A0 ((: "<" id "/>")
>=C2=A0 =C2=A0 =C2=A0 (let ((t (the-substring 1 (-fx (the-length) 2))))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (let ((p pos))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (update-start-position!)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (make (string->symbol t) '() '()=
 p))))
>=C2=A0 =C2=A0 =C2=A0 ((: "<" id (in " \n\t\r"))
>=C2=A0 =C2=A0 =C2=A0 (let* ((t (the-substring 1 (-fx (the-length) 1)))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (ts (string->symbol t))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (p (the-port)))
>=C2=A0 =C2=A0 =C2=A0 (let loop ((attr '()))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 (let ((obj (read/rp attribute-grammar p t stri=
ct decoder)))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 (cond
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ((pair? obj)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (loop (cons obj attr)))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ((eq? obj '>)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (let ((element (collect-up-to po=
s ignore-w/-pos-update! ts (reverse! attr) p make specials strict content-p=
os decoder encoding)))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 (update-start-position!)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 element))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ((eq? obj '/>)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (let=
 ((p pos))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 (update-start-position!)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 (make ts (reverse! attr) '() p))))))))
>=C2=A0 =C2=A0 =C2=A0 ((: "</" id ">")
>=C2=A0 =C2=A0 =C2=A0 (update-start-position!)
>=C2=A0 =C2=A0 =C2=A0 (string->symbol (the-substring 2 (-fx (the-length) 1)=
)))
>=C2=A0 =C2=A0 =C2=A0 ((+ (out "<"))
>=C2=A0 =C2=A0 =C2=A0 (update-start-position!)
>=C2=A0 =C2=A0 =C2=A0 (if content-pos
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (let ((pos2 (- pos (the-length))))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (list (decoder (the-string)) pos=
2))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (decoder (the-string))))
>=C2=A0 =C2=A0 =C2=A0 (else
>=C2=A0 =C2=A0 =C2=A0 (let ((c (the-failure)))
>=C2=A0 =C2=A0 =C2=A0 (cond
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 ((not (eof-object? c))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (xml-parse-error "Illegal character"
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (error-line=
 c (the-port))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (input-port=
-name (the-port))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (input-port=
-position (the-port))))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 (else
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 c))))))
>
> ;*---------------------------------------------------------------------*/
> ;*=C2=A0 =C2=A0 char-hexnumeric? ...=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 */
> ;*---------------------------------------------------------------------*/
> (define (char-hexnumeric? c)
>=C2=A0 (or (char-numeric? c)
>=C2=A0 =C2=A0 =C2=A0 (and (char>=3D? c #\A) (char<=3D? c #\F))
>=C2=A0 =C2=A0 =C2=A0 (and (char>=3D? c #\a) (char<=3D? c #\f))))
>
> ;*---------------------------------------------------------------------*/
> ;*=C2=A0 =C2=A0 xml-string-decode-inner! ...=C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 */
> ;*---------------------------------------------------------------------*/
> (define (xml-string-decode-inner! str ol nl res)
>=C2=A0 (define (char-value c)
>=C2=A0 =C2=A0 =C2=A0 (cond
>=C2=A0 =C2=A0 ((char-numeric? c)
>=C2=A0 =C2=A0 =C2=A0 (-fx (char->integer c) (char->integer #\0)))
>=C2=A0 =C2=A0 ((char<=3D? c #\F)
>=C2=A0 =C2=A0 =C2=A0 (+fx 10 (-fx (char->integer c) (char->integer #\A))))
>=C2=A0 =C2=A0 (else
>=C2=A0 =C2=A0 =C2=A0 (+fx 10 (-fx (char->integer c) (char->integer #\a))))=
))
>=C2=A0 (let ((ol-2 (-fx ol 2)))
>=C2=A0 =C2=A0 =C2=A0 (let loop ((i 0)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 (j 0))
>=C2=A0 =C2=A0 (if (=3Dfx j nl)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 res
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 (let ((c (string-ref str i)))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 (if (and (char=3D? c #\%) (<fx i ol-2))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (let ((c1 (string-ref str (+fx i=
 1)))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (c2 (string-ref str (+fx =
i 2))))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (if (and (char-hexnumeric=
? c1) (char-hexnumeric? c2))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (let* ((v1 (char-value c1=
))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (v2 (char-v=
alue c2))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (d (integer=
->char (+fx (*fx v1 16) v2))))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (string-set=
! res j d)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (loop (+fx =
i 3) (+fx j 1)))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (begin
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (string-set=
! res j c)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (loop (+fx =
i 1) (+fx j 1)))))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (begin
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (string-set! res j c)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (loop (+fx i 1) (+fx j 1)=
))))))))
>
> ;*---------------------------------------------------------------------*/
> ;*=C2=A0 =C2=A0 xml-count ...=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 */
> ;*---------------------------------------------------------------------*/
> (define (xml-count str ol)
>=C2=A0 (let loop ((i 0)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (c 0))
>=C2=A0 =C2=A0 =C2=A0 (cond
>=C2=A0 =C2=A0 ((=3Dfx i ol)
>=C2=A0 =C2=A0 =C2=A0 c)
>=C2=A0 =C2=A0 ((char=3D? (string-ref str i) #\&)
>=C2=A0 =C2=A0 =C2=A0 (cond
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 ((substring-at? str "&lt;" i)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (loop (+fx i 4) (+fx c 1)))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 ((substring-at? str "&gt;" i)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (loop (+fx i 4) (+fx c 1)))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 ((substring-at? str "&amp;" i)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (loop (+fx i 5) (+fx c 1)))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 ((substring-at? str "&quot;" i)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (loop (+fx i 6) (+fx c 1)))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 ((substring-at? str "&nbsp;" i)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (loop (+fx i 6) (+fx c 1)))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 ((substring-at? str "&#" i)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (let liip ((i (+fx i 2)))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 (cond
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ((=3Dfx i ol)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 c)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ((char-numeric? (string-ref str =
i))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (liip (+fx i 1)))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (else
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (loop (+fx i 1) (+fx c 1))))))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 (else
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (loop (+fx i 1) (+fx c 1)))))
>=C2=A0 =C2=A0 (else
>=C2=A0 =C2=A0 =C2=A0 (loop (+fx i 1) (+fx c 1))))))
>
> ;*---------------------------------------------------------------------*/
> ;*=C2=A0 =C2=A0 xml-decode ...=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 */
> ;*---------------------------------------------------------------------*/
> (define (xml-decode! str res ol nl)
>=C2=A0 (let loop ((i 0)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (j 0))
>=C2=A0 =C2=A0 =C2=A0 (cond
>=C2=A0 =C2=A0 ((=3Dfx i ol)
>=C2=A0 =C2=A0 =C2=A0 res)
>=C2=A0 =C2=A0 ((char=3D? (string-ref str i) #\&)
>=C2=A0 =C2=A0 =C2=A0 (cond
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 ((substring-at? str "&lt;" i)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (string-set! res j #\<)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (loop (+fx i 4) (+fx j 1)))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 ((substring-at? str "&gt;" i)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (string-set! res j #\>)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (loop (+fx i 4) (+fx j 1)))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 ((substring-at? str "&amp;" i)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (string-set! res j #\&)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (loop (+fx i 5) (+fx j 1)))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 ((substring-at? str "&quot;" i)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (string-set! res j #\")
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (loop (+fx i 6) (+fx j 1)))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 ((substring-at? str "&nbsp;" i)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (string-set! res j #\space)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (loop (+fx i 6) (+fx j 1)))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 ((substring-at? str "&#" i)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (let liip ((i (+fx i 2))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (n 0))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 (if (=3Dfx i ol)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 res
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (let ((c (string-ref str i)))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (if (char-numeric? c)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (liip (+fx i 1)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (+fx (*fx n=
 10)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (-fx (char-=
>integer c)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (cha=
r->integer #\0))))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (begin
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (string-set=
! res j (integer->char n))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (loop (+fx =
i 1) (+fx j 1))))))))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 (else
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (string-set! res j (string-ref str i))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (loop (+fx i 1) (+fx j 1)))))
>=C2=A0 =C2=A0 (else
>=C2=A0 =C2=A0 =C2=A0 (string-set! res j (string-ref str i))
>=C2=A0 =C2=A0 =C2=A0 (loop (+fx i 1) (+fx j 1))))))
>
> ;*---------------------------------------------------------------------*/
> ;*=C2=A0 =C2=A0 xml-string-decode ...=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 */
> ;*---------------------------------------------------------------------*/
> (define (xml-string-decode str)
>=C2=A0 (let ((ol (string-length str)))
>=C2=A0 =C2=A0 =C2=A0 (if (>=3Dfx ol 3)
>=C2=A0 =C2=A0 =C2=A0 (let ((nl (xml-count str ol)))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 (if (=3Dfx nl ol)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 (string-copy str)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 (let ((res (make-string nl)))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (xml-decode! str res ol nl)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 res)))
>=C2=A0 =C2=A0 =C2=A0 (string-copy str))))
>
> ;*---------------------------------------------------------------------*/
> ;*=C2=A0 =C2=A0 xml-string-decode! ...=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 */
> ;*---------------------------------------------------------------------*/
> (define (xml-string-decode! str)
>=C2=A0 (let ((ol (string-length str)))
>=C2=A0 =C2=A0 =C2=A0 (if (>=3Dfx ol 3)
>=C2=A0 =C2=A0 =C2=A0 (let ((nl (xml-count str ol)))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 (if (=3Dfx nl ol)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 str
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 (begin
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (xml-decode! str str ol nl)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (string-shrink! str nl))))
>=C2=A0 =C2=A0 =C2=A0 str)))
>
> ;*---------------------------------------------------------------------*/
> ;*=C2=A0 =C2=A0 xml-string-encode ...=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 */
> ;*---------------------------------------------------------------------*/
> (define (xml-string-encode str)
>=C2=A0 (define (count str ol)
>=C2=A0 =C2=A0 =C2=A0 (let loop ((i 0)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 (n 0))
>=C2=A0 =C2=A0 (if (=3Dfx i ol)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 n
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 (let ((c (string-ref str i)))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 (case c
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ((#\")
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (loop (+fx i 1) (+fx n 6)))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ((#\&)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (loop (+fx i 1) (+fx n 5)))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ((#\< #\>)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (loop (+fx i 1) (+fx n 4)))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (else
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (loop (+fx i 1) (+fx n 1))))))))
>=C2=A0 (define (encode str ol nl)
>=C2=A0 =C2=A0 =C2=A0 (if (=3Dfx nl ol)
>=C2=A0 =C2=A0 =C2=A0 str
>=C2=A0 =C2=A0 =C2=A0 (let ((res (make-string nl)))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 (let loop ((i 0)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (j 0))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 (if (=3Dfx j nl)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 res
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (let ((c (string-ref str i)))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (case c
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ((#\<)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (blit-string! "&lt;" 0 re=
s j 4)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (loop (+fx i 1) (+fx j 4)=
))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ((#\>)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (blit-string! "&gt;" 0 re=
s j 4)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (loop (+fx i 1) (+fx j 4)=
))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ((#\&)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (blit-string! "&amp;" 0 r=
es j 5)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (loop (+fx i 1) (+fx j 5)=
))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ((#\")
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (blit-string! "&quot;" 0 =
res j 6)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (loop (+fx i 1) (+fx j 6)=
))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (else
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (string-set! res j c)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (loop (+fx i 1) (+fx j 1)=
)))))))))
>=C2=A0 (let ((ol (string-length str)))
>=C2=A0 =C2=A0 =C2=A0 (encode str ol (count str ol))))
>
> ;*---------------------------------------------------------------------*/
> ;*=C2=A0 =C2=A0 read-xml ...=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 */
> ;*---------------------------------------------------------------------*/
> (define (read-xml #!optional (port::input-port (current-input-port)))
>=C2=A0 (xml-parse port))
>
> ;*---------------------------------------------------------------------*/
> ;*=C2=A0 =C2=A0 xml-metadata ...=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 */
> ;*---------------------------------------------------------------------*/
> (define (xml-metadata xml)
>=C2=A0 (let ((xml-ver #f)
>=C2=A0 =C2=A0 (xml-enc #f)
>=C2=A0 =C2=A0 (xml-lang #f)
>=C2=A0 =C2=A0 (root-ver 0.0)
>=C2=A0 =C2=A0 (xml-root #f)
>=C2=A0 =C2=A0 (xml-ns '()))
>=C2=A0 =C2=A0 =C2=A0 (let loop1 ((l xml))
>=C2=A0 =C2=A0 (when (pair? l)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 (match-case (car l)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ((xml-decl . (and ?attr (?- . ?-)))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 (for-each (lambda (at)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (case (car at)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ((version) (set! x=
ml-ver (cdr attr)))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ((encoding) (set! =
xml-enc (cdr attr)))))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 attr))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ((?mark ?lattr . ?-)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 (let loop3 ((lattr lattr))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (unless xml-root (set! xml-root mark))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (when (pair? lattr)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (let ((attr (car lattr)))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (case (car attr)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ((xml:lang)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (set! xml-lang (cd=
r attr)))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ((xmlns)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (set! xml-root (co=
ns (cdr attr) xml-root)))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ((version)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (set! root-ver (st=
ring->number (cdr attr))))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (else
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (let ((str (symbol=
->string (car attr))))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (when (substring=
=3D? str "xmlns:" 6)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (let* ((l (=
string-length str))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 (s (substring str 6 l))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 (si (string->symbol s)))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 (set! xml-ns
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 (cons (cons (cdr attr) si)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 xml-ns)))))))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (loop3 (cdr lattr)))))))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 (loop1 (cdr l))))
>=C2=A0 =C2=A0 =C2=A0 (unless xml-root
>=C2=A0 =C2=A0 (error "xml-metadata" "Empty XML document !" xml))
>=C2=A0 =C2=A0 =C2=A0 ;; Values are :
>=C2=A0 =C2=A0 =C2=A0 ;; - XML Version (1.0 or 1.1) or #f
>=C2=A0 =C2=A0 =C2=A0 ;; - XML Encoding (#f if unknown)
>=C2=A0 =C2=A0 =C2=A0 ;; - xml:lang value
>=C2=A0 =C2=A0 =C2=A0 ;; - Pair, which car is the first data markup, and
>=C2=A0 =C2=A0 =C2=A0 ;;=C2=A0 cdr the default namespace
>=C2=A0 =C2=A0 =C2=A0 ;; - xml first data markup version attribute (0 if un=
specified)
>=C2=A0 =C2=A0 =C2=A0 ;; - list of prefixed namespaces (prefix . path)
>=C2=A0 =C2=A0 =C2=A0 (values xml-ver xml-enc xml-lang xml-root root-ver xm=
l-ns)))
 =20
------=_Part_2269273_182048361.1644899034175
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<html><head></head><body><div class=3D"ydpa4c1145byahoo-style-wrap" style=
=3D"font-family:Helvetica Neue, Helvetica, Arial, sans-serif;font-size:13px=
;"><div></div>
        <div dir=3D"ltr" data-setdir=3D"false">Hello, Sven,</div><div dir=
=3D"ltr" data-setdir=3D"false"><br></div><div dir=3D"ltr" data-setdir=3D"fa=
lse">I extended xml-parse so that it takes procedures for creating all of t=
he xml constructs. It makes the parser more flexible and may be useful some=
 use cases.</div><div dir=3D"ltr" data-setdir=3D"false"><br></div><div dir=
=3D"ltr" data-setdir=3D"false">Best Regards,</div><div dir=3D"ltr" data-set=
dir=3D"false">Joe Donaldson<br></div><div><br></div>
       =20
        </div><div id=3D"ydp3c14b27dyahoo_quoted_5406291286" class=3D"ydp3c=
14b27dyahoo_quoted">
            <div style=3D"font-family:'Helvetica Neue', Helvetica, Arial, s=
ans-serif;font-size:13px;color:#26282a;">
               =20
                <div>
                    On Monday, February 14, 2022, 12:13:44 PM PST, Sven Har=
trumpf &lt;[email protected]&gt; wrote:
                </div>
                <div><br></div>
                <div><br></div>
                <div><div dir=3D"ltr">Hello Joe.<br></div><div dir=3D"ltr">=
<br></div><div dir=3D"ltr">donaldsonjw, 2022-02-14 17:04:<br></div><div dir=
=3D"ltr">&gt; What do you think of changing content-pos to make-content wit=
h it being a procedure for constructing a content object. It will take 2 ar=
guments, the content string and the position of the string. The default imp=
lementation just returns the content string, but one can provide his<br></d=
iv><div dir=3D"ltr">&gt; or her own implementation. I also think changing t=
he procedure argument to make-element indicates its purpose better.<br></di=
v><div dir=3D"ltr"><br></div><div dir=3D"ltr">I thought about this before :=
-)<br></div><div dir=3D"ltr">Fits the rest of the code much better.<br></di=
v><div dir=3D"ltr"><br></div><div dir=3D"ltr">&gt; I have attached a versio=
n of xml.scm with these changes. If providing make-element and make-content=
 is a good idea perhaps we should also parameterize xml-parse<br></div><div=
 dir=3D"ltr">&gt; with make-cdata, make-comment, make-declaration, and so o=
n.<br></div><div dir=3D"ltr"><br></div><div dir=3D"ltr">I am neutral about =
these, but I can envision some use cases for these extensions.<br></div><di=
v dir=3D"ltr"><br></div><div dir=3D"ltr">Regards<br></div><div dir=3D"ltr">=
Sven<br></div><div dir=3D"ltr"><br></div><div dir=3D"ltr">&gt; Best Regards=
,<br></div><div dir=3D"ltr">&gt; Joe Donaldson<br></div><div dir=3D"ltr">&g=
t;<br></div><div dir=3D"ltr">&gt; On Thursday, February 10, 2022, 09:42:43 =
AM PST, Sven Hartrumpf &lt;<a href=3D"mailto:[email protected]" rel=3D"nofo=
llow" target=3D"_blank">[email protected]</a>&gt; wrote:<br></div><div dir=
=3D"ltr">&gt;<br></div><div dir=3D"ltr">&gt; Hello Joe.<br></div><div dir=
=3D"ltr">&gt;<br></div><div dir=3D"ltr">&gt; donaldsonjw, 2022-02-06 01:00:=
<br></div><div dir=3D"ltr">&gt;&gt; Here is another version of xml.scm that=
 I believe addresses the problem you pointed out. Let me know how it works =
for you.<br></div><div dir=3D"ltr">&gt;<br></div><div dir=3D"ltr">&gt; Than=
ks again.<br></div><div dir=3D"ltr">&gt; I had to fix two calls of 'make' b=
y moving the position to the end, see attached file,<br></div><div dir=3D"l=
tr">&gt; then everyting worked like a charm.<br></div><div dir=3D"ltr">&gt;=
<br></div><div dir=3D"ltr">&gt; To finish my problem solution and test it (=
successfully) on some thousand nontrivial<br></div><div dir=3D"ltr">&gt; xm=
l files, I had to add a new option content-pos. If true, content strings ar=
e turned into<br></div><div dir=3D"ltr">&gt; (content-string offset). The c=
hanges are backward-compatible because the default is content-pos #f.<br></=
div><div dir=3D"ltr">&gt; The representation (and the name of the option) m=
ight not fit the rest, so feel free to change it.<br></div><div dir=3D"ltr"=
>&gt;<br></div><div dir=3D"ltr">&gt; You can open a pull request on bigloo'=
s github soon, I guess.<br></div><div dir=3D"ltr">&gt;<br></div><div dir=3D=
"ltr">&gt; Greetings<br></div><div dir=3D"ltr">&gt;<br></div><div dir=3D"lt=
r">&gt; Sven<br></div><div dir=3D"ltr">&gt; ;*=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D*/<br></div><div dir=3D"ltr">&gt; ;*&nbsp; &n=
bsp; serrano/prgm/project/bigloo/bigloo/api/web/src/Llib/xml.scm&nbsp; &nbs=
p; &nbsp; */<br></div><div dir=3D"ltr">&gt; ;*&nbsp; &nbsp; ---------------=
----------------------------------------------&nbsp; &nbsp; */<br></div><di=
v dir=3D"ltr">&gt; ;*&nbsp; &nbsp; Author&nbsp; &nbsp; &nbsp; :&nbsp; Manue=
l Serrano&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nb=
sp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; */<br></div><di=
v dir=3D"ltr">&gt; ;*&nbsp; &nbsp; Creation&nbsp; &nbsp; :&nbsp; Fri Mar 11=
 16:23:53 2005&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp=
; &nbsp; &nbsp; &nbsp; &nbsp; */<br></div><div dir=3D"ltr">&gt; ;*&nbsp; &n=
bsp; Last change :&nbsp; Sun Oct&nbsp; 7 08:46:03 2018 (serrano)&nbsp; &nbs=
p; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; */<br></div><div dir=3D"ltr">&=
gt; ;*&nbsp; &nbsp; Copyright&nbsp; :&nbsp; 2005-18 Manuel Serrano&nbsp; &n=
bsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; =
&nbsp; &nbsp; */<br></div><div dir=3D"ltr">&gt; ;*&nbsp; &nbsp; -----------=
--------------------------------------------------&nbsp; &nbsp; */<br></div=
><div dir=3D"ltr">&gt; ;*&nbsp; &nbsp; XML parsing&nbsp; &nbsp; &nbsp; &nbs=
p; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &n=
bsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; =
&nbsp; &nbsp; */<br></div><div dir=3D"ltr">&gt; ;*=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D*/<br></div><div dir=3D"ltr">&gt;<br></div=
><div dir=3D"ltr">&gt; ;*--------------------------------------------------=
-------------------*/<br></div><div dir=3D"ltr">&gt; ;*&nbsp; &nbsp; The mo=
dule&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &=
nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;=
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; */<br></div><div dir=3D"ltr">&gt=
; ;*---------------------------------------------------------------------*/=
<br></div><div dir=3D"ltr">&gt; (module __web_xml<br></div><div dir=3D"ltr"=
>&gt;<br></div><div dir=3D"ltr">&gt;&nbsp;  (option (set! *dlopen-init-gc* =
#t))<br></div><div dir=3D"ltr">&gt;<br></div><div dir=3D"ltr">&gt;&nbsp;  (=
export (xml-parse::pair-nil port::input-port<br></div><div dir=3D"ltr">&gt;=
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  #!key<br></div><di=
v dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  =
(content-length 0)<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp; &nbsp=
; &nbsp; &nbsp; &nbsp; &nbsp;  (procedure (lambda (tag attribs body start-p=
os)<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;=
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbs=
p; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  (list tag attribs body)))<br>=
</div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;=
 &nbsp;  (specials '())<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp; =
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  (strict #t)<br></div><div dir=3D"ltr">&=
gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &n=
bsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  (content-pos #f)<br></div><div dir=
=3D"ltr">&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  (enco=
ding 'UTF-8)<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbs=
p; &nbsp; &nbsp; &nbsp;  (eoi #f))<br></div><div dir=3D"ltr">&gt;&nbsp; &nb=
sp; &nbsp;  (xml-string-decode::bstring ::bstring)<br></div><div dir=3D"ltr=
">&gt;&nbsp; &nbsp; &nbsp;  (xml-string-decode!::bstring ::bstring)<br></di=
v><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp;  (xml-string-encode::bstring ::=
bstring)<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp;  (read-xml #!op=
tional (port::input-port (current-input-port)))<br></div><div dir=3D"ltr">&=
gt;&nbsp; &nbsp; &nbsp;  (xml-metadata xml-tree::pair-nil)))<br></div><div =
dir=3D"ltr">&gt;<br></div><div dir=3D"ltr">&gt; ;*-------------------------=
--------------------------------------------*/<br></div><div dir=3D"ltr">&g=
t; ;*&nbsp; &nbsp; xml-parse ...&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &=
nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;=
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; */<br></div=
><div dir=3D"ltr">&gt; ;*--------------------------------------------------=
-------------------*/<br></div><div dir=3D"ltr">&gt; (define (xml-parse::pa=
ir-nil port::input-port<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp; =
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  #!key<br></div><div dir=3D"ltr">&gt;&nb=
sp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  (content-length 0)<br=
></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp=
; &nbsp;  (procedure (lambda (tag attribs body start-pos)<br></div><div dir=
=3D"ltr">&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;=
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbs=
p; &nbsp;  (list tag attribs body)))<br></div><div dir=3D"ltr">&gt;&nbsp; &=
nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;=
 &nbsp; &nbsp;  (specials '())<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; =
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  (strict #t)<br></div><div dir=3D=
"ltr">&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &n=
bsp; &nbsp; &nbsp; &nbsp; &nbsp;  (content-pos #f)<br></div><div dir=3D"ltr=
">&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  (encoding 'U=
TF-8)<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbs=
p; &nbsp; &nbsp;  (eoi #f))<br></div><div dir=3D"ltr">&gt;&nbsp;  (when (el=
ong? content-length)<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp;  (s=
et! content-length (elong-&gt;fixnum content-length)))<br></div><div dir=3D=
"ltr">&gt;&nbsp;  (when (and (fixnum? content-length) (&gt;fx content-lengt=
h 0))<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp;  (input-port-fill-=
barrier-set! port content-length))<br></div><div dir=3D"ltr">&gt;&nbsp;  (w=
hen (&gt;fx content-length 0)<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &=
nbsp;  (set! content-length (+fx content-length (input-port-position port))=
))<br></div><div dir=3D"ltr">&gt;&nbsp;  (let loop ((decoder (lambda (x) x)=
))<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp;  (let ((obj (read/rp =
xml-grammar port procedure procedure specials strict content-pos decoder en=
coding (input-port-position port))))<br></div><div dir=3D"ltr">&gt;&nbsp; &=
nbsp;  (when (and (fixnum? content-length) (&gt;fx content-length 0))<br></=
div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp; &nbsp;  (input-port-fill-barr=
ier-set! port -1))<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp;  (cond<br></=
div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp; &nbsp;  ((eof-object? obj)<br=
></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp; &nbsp;  '())<br></div><div=
 dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp; &nbsp;  ((or (and (procedure? eoi) (e=
oi obj))<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp; &nbsp;  (and (&=
gt;fx content-length 0)<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp; =
&nbsp; &nbsp; &nbsp; &nbsp;  (&gt;=3Dfx (input-port-position port) content-=
length)))<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp; &nbsp;  (list =
obj))<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp; &nbsp;  ((and (pai=
r? obj) (eq? 'xml-decl (car obj)))<br></div><div dir=3D"ltr">&gt;&nbsp; &nb=
sp; &nbsp; &nbsp;  (let ((enc (assq 'encoding (cdr obj))))<br></div><div di=
r=3D"ltr">&gt;&nbsp; &nbsp; &nbsp; &nbsp;  (if enc<br></div><div dir=3D"ltr=
">&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  (cons obj (loop (get-decod=
er (cdr enc) encoding)))<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp;=
 &nbsp; &nbsp; &nbsp;  (cons obj (loop decoder)))))<br></div><div dir=3D"lt=
r">&gt;&nbsp; &nbsp; &nbsp; &nbsp;  (else<br></div><div dir=3D"ltr">&gt;&nb=
sp; &nbsp; &nbsp; &nbsp;  (cons obj (loop decoder)))))))<br></div><div dir=
=3D"ltr">&gt;<br></div><div dir=3D"ltr">&gt; ;*----------------------------=
-----------------------------------------*/<br></div><div dir=3D"ltr">&gt; =
;*&nbsp; &nbsp; xml-parse-error ...&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp=
; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nb=
sp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; */<br></div><div dir=3D"ltr">=
&gt; ;*--------------------------------------------------------------------=
-*/<br></div><div dir=3D"ltr">&gt; (define (xml-parse-error msg obj name po=
s)<br></div><div dir=3D"ltr">&gt;&nbsp;  (raise<br></div><div dir=3D"ltr">&=
gt;&nbsp; &nbsp;  (instantiate::&amp;io-parse-error<br></div><div dir=3D"lt=
r">&gt;&nbsp; &nbsp; &nbsp;  (proc 'xml-parse)<br></div><div dir=3D"ltr">&g=
t;&nbsp; &nbsp; &nbsp;  (msg msg)<br></div><div dir=3D"ltr">&gt;&nbsp; &nbs=
p; &nbsp;  (obj obj)<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp;  (f=
name name)<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp;  (location po=
s))))<br></div><div dir=3D"ltr">&gt;<br></div><div dir=3D"ltr">&gt; ;*-----=
----------------------------------------------------------------*/<br></div=
><div dir=3D"ltr">&gt; ;*&nbsp; &nbsp; error-line ...&nbsp; &nbsp; &nbsp; &=
nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;=
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbs=
p; */<br></div><div dir=3D"ltr">&gt; ;*------------------------------------=
---------------------------------*/<br></div><div dir=3D"ltr">&gt; (define =
(error-line c port)<br></div><div dir=3D"ltr">&gt;&nbsp;  (let ((line (read=
-line port)))<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp;  (string-a=
ppend "{" (string c) "}" (if (string? line) line ""))))<br></div><div dir=
=3D"ltr">&gt;<br></div><div dir=3D"ltr">&gt; ;*----------------------------=
-----------------------------------------*/<br></div><div dir=3D"ltr">&gt; =
;*&nbsp; &nbsp; special ...&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;=
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbs=
p; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; */<br></d=
iv><div dir=3D"ltr">&gt; ;*------------------------------------------------=
---------------------*/<br></div><div dir=3D"ltr">&gt; (define-struct speci=
al tag attributes body owner)<br></div><div dir=3D"ltr">&gt;<br></div><div =
dir=3D"ltr">&gt; ;*--------------------------------------------------------=
-------------*/<br></div><div dir=3D"ltr">&gt; ;*&nbsp; &nbsp; collect-up-t=
o ...&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; =
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp=
; &nbsp; &nbsp; &nbsp; */<br></div><div dir=3D"ltr">&gt; ;*----------------=
-----------------------------------------------------*/<br></div><div dir=
=3D"ltr">&gt; (define (collect-up-to start-pos ignore tag attributes port m=
ake specials strict content-pos decoder encoding)<br></div><div dir=3D"ltr"=
>&gt;<br></div><div dir=3D"ltr">&gt;&nbsp;  (define (collect ignore tags)<b=
r></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp;  (let ((name (input-port-=
name port))<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp; &nbsp;  (po =
(input-port-position port)))<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp;  (=
let loop ((acc '())<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp; &nbs=
p; &nbsp; &nbsp;  (item (ignore)))<br></div><div dir=3D"ltr">&gt;&nbsp; &nb=
sp; &nbsp; &nbsp;  (cond<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp;=
 &nbsp; &nbsp;  ((symbol? item)<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp;=
 &nbsp; &nbsp;  (cond<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp; &n=
bsp; &nbsp;  ((eq? item tag)<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &n=
bsp; &nbsp; &nbsp; &nbsp;  (make tag attributes (reverse! acc) start-pos))<=
br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  (strict<b=
r></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  (xm=
l-parse-error "Illegal closing tag"<br></div><div dir=3D"ltr">&gt;&nbsp; &n=
bsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  (format "`~a' expected, `~a' provi=
ded"<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp=
; &nbsp;  tag item)<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp; &nbs=
p; &nbsp; &nbsp; &nbsp;  name po))<br></div><div dir=3D"ltr">&gt;&nbsp; &nb=
sp; &nbsp; &nbsp; &nbsp;  (else<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp;=
 &nbsp; &nbsp; &nbsp; &nbsp;  (make tag attributes (reverse! acc) start-pos=
))))<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  ((sp=
ecial? item)<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp; &nbsp;  (le=
t ((nitem (make (special-tag item)<br></div><div dir=3D"ltr">&gt;&nbsp; &nb=
sp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  (special-attributes item)<br=
></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp=
; &nbsp;  (special-body item)<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &=
nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;=
 &nbsp; &nbsp; &nbsp;  start-pos)))<br></div><div dir=3D"ltr">&gt;&nbsp; &n=
bsp; &nbsp; &nbsp; &nbsp;  (if (memq (special-tag item) tags)<br></div><div=
 dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  (loop ac=
c nitem)<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &=
nbsp; &nbsp;  (list (make tag attributes (reverse! acc) start-pos) nitem)))=
)<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  ((eof-o=
bject? item)<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp; &nbsp;  (if=
 strict<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &n=
bsp;  (xml-parse-error<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp; &=
nbsp; &nbsp; &nbsp; &nbsp;  (format "Premature end of line, expecting tag `=
~a'"<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp=
; &nbsp;  tag)<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp; &nbsp; &n=
bsp; &nbsp; &nbsp;  item name po)<br></div><div dir=3D"ltr">&gt;&nbsp; &nbs=
p; &nbsp; &nbsp; &nbsp; &nbsp;  (make tag attributes (reverse! acc) start-p=
os)))<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  (el=
se<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp; &nbsp;  (let ((po (in=
put-port-last-token-position port)))<br></div><div dir=3D"ltr">&gt;&nbsp; &=
nbsp; &nbsp; &nbsp; &nbsp;  (loop (econs item acc (list 'at name po)) (igno=
re))))))))<br></div><div dir=3D"ltr">&gt;<br></div><div dir=3D"ltr">&gt;&nb=
sp;  (let ((spec (assq tag specials)))<br></div><div dir=3D"ltr">&gt;&nbsp;=
 &nbsp; &nbsp;  (cond<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp;  ((not sp=
ec)<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp;  (collect ignore '()=
))<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp;  ((null? (cdr spec))<br></di=
v><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp;  (make tag attributes '() start=
-pos))<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp;  ((procedure? (cdr spec)=
)<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp;  (make tag attributes =
((cdr spec) port) start-pos))<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp;  =
((pair? (cdr spec))<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp;  (le=
t ((ignore (lambda ()<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp; &n=
bsp; &nbsp; &nbsp; &nbsp;  (read/rp xml-grammar port<br></div><div dir=3D"l=
tr">&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbs=
p;  (lambda (t a b) (special t a b tag))<br></div><div dir=3D"ltr">&gt;&nbs=
p; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  make<br>=
</div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;=
 &nbsp; &nbsp; &nbsp;  specials strict content-pos decoder encoding (input-=
port-position port)))))<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp; =
&nbsp;  (collect ignore (cdr spec))))<br></div><div dir=3D"ltr">&gt;&nbsp; =
&nbsp;  (else<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp;  (error "x=
ml-parse" "Illegal special handler" spec)))))<br></div><div dir=3D"ltr">&gt=
;<br></div><div dir=3D"ltr">&gt; ;*----------------------------------------=
-----------------------------*/<br></div><div dir=3D"ltr">&gt; ;*&nbsp; &nb=
sp; attribute-value-grammar ...&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &n=
bsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; =
&nbsp; &nbsp; */<br></div><div dir=3D"ltr">&gt; ;*-------------------------=
--------------------------------------------*/<br></div><div dir=3D"ltr">&g=
t; (define attribute-value-grammar<br></div><div dir=3D"ltr">&gt;&nbsp;  (r=
egular-grammar (strict tag)<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nb=
sp;  ((+ (in " \t\n\r"))<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp;=
  (ignore))<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp;  ((: #\" (* =
(or (out #\\ #\") (: #\\ all))) #\")<br></div><div dir=3D"ltr">&gt;&nbsp; &=
nbsp; &nbsp;  (the-substring 1 (-fx (the-length) 1)))<br></div><div dir=3D"=
ltr">&gt;&nbsp; &nbsp; &nbsp;  ((: #\' (* (or (out #\\ #\') (: #\\ all))) #=
\')<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp;  (the-substring 1 (-=
fx (the-length) 1)))<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp;  ((=
: (+ digit) (? (or "%" "px" "cm" "em" "mm" "inch")))<br></div><div dir=3D"l=
tr">&gt;&nbsp; &nbsp; &nbsp;  (if strict<br></div><div dir=3D"ltr">&gt;&nbs=
p; &nbsp; &nbsp;  (xml-parse-error (format "Illegal `~a' attribute value" t=
ag)<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;=
 &nbsp; &nbsp;  (the-string)<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &n=
bsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  (input-port-name (the-port))<br></=
div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &=
nbsp;  (input-port-position (the-port)))<br></div><div dir=3D"ltr">&gt;&nbs=
p; &nbsp; &nbsp;  (the-string)))<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp=
; &nbsp;  ((+ (out " \t\n\r&lt;&gt;(){}[]@!\"'/"))<br></div><div dir=3D"ltr=
">&gt;&nbsp; &nbsp; &nbsp;  (if strict<br></div><div dir=3D"ltr">&gt;&nbsp;=
 &nbsp; &nbsp;  (xml-parse-error (format "Illegal `~a' attribute character"=
 tag)<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbs=
p; &nbsp; &nbsp;  (the-string)<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; =
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  (input-port-name (the-port))<br>=
</div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;=
 &nbsp;  (input-port-position (the-port)))<br></div><div dir=3D"ltr">&gt;&n=
bsp; &nbsp; &nbsp;  (the-string)))<br></div><div dir=3D"ltr">&gt;&nbsp; &nb=
sp; &nbsp;  (else<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp;  (let =
((c (the-failure)))<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp;  (if=
 (not (eof-object? c))<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp; &=
nbsp; &nbsp;  (if (or strict<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &n=
bsp; &nbsp; &nbsp; &nbsp; &nbsp;  (not (or (char=3D? c #\space)<br></div><d=
iv dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; =
&nbsp;  (char=3D? c #\Newline)<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; =
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  (char=3D? c #\&gt;))))<br=
></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  (xml-parse-=
error<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  (fo=
rmat "Illegal `~a' attribute character" tag)<br></div><div dir=3D"ltr">&gt;=
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  (error-line c (the-port))<br></div><div=
 dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  (input-port-name (the-=
port))<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  (i=
nput-port-position (the-port)))<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp;=
 &nbsp; &nbsp; &nbsp;  " ")<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nb=
sp; &nbsp; &nbsp;  (xml-parse-error<br></div><div dir=3D"ltr">&gt;&nbsp; &n=
bsp; &nbsp; &nbsp; &nbsp;  (format "Premature end of line for tag `~a' attr=
ibute" tag)<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp=
;  c<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  (inp=
ut-port-name (the-port))<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp;=
 &nbsp; &nbsp;  (-fx (input-port-position (the-port)) 1)))))))<br></div><di=
v dir=3D"ltr">&gt;<br></div><div dir=3D"ltr">&gt; ;*-----------------------=
----------------------------------------------*/<br></div><div dir=3D"ltr">=
&gt; ;*&nbsp; &nbsp; attribute-grammar ...&nbsp; &nbsp; &nbsp; &nbsp; &nbsp=
; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nb=
sp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; */<br></div><div dir=3D"ltr">=
&gt; ;*--------------------------------------------------------------------=
-*/<br></div><div dir=3D"ltr">&gt; (define attribute-grammar<br></div><div =
dir=3D"ltr">&gt;&nbsp;  (regular-grammar ((id (: (in ("azAZ") "_") (* (in (=
"azAZ09") ":_-"))))<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp; &nbs=
p; &nbsp; &nbsp;  tag<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp; &n=
bsp; &nbsp; &nbsp;  strict<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbs=
p; &nbsp; &nbsp; &nbsp;  decoder)<br></div><div dir=3D"ltr">&gt;&nbsp; &nbs=
p; &nbsp;  ((+ (in " \t\n\r"))<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; =
&nbsp;  (ignore))<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp;  ((: i=
d "=3D")<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp;  (let* ((key (t=
he-substring 0 (-fx (the-length) 1)))<br></div><div dir=3D"ltr">&gt;&nbsp; =
&nbsp; &nbsp; &nbsp; &nbsp;  (val (read/rp attribute-value-grammar (the-por=
t) strict tag)))<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp;  (cons =
(string-&gt;symbol (decoder key)) (decoder val))))<br></div><div dir=3D"ltr=
">&gt;&nbsp; &nbsp; &nbsp;  ((: id (+ blank) "=3D")<br></div><div dir=3D"lt=
r">&gt;&nbsp; &nbsp; &nbsp;  (let* ((key (the-substring 0 (-fx (the-length)=
 2)))<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  (va=
l (read/rp attribute-value-grammar (the-port) strict tag)))<br></div><div d=
ir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp;  (let loop ((i (-fx (string-length key)=
 1)))<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp; &nbsp;  (case (str=
ing-ref key i)<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp; &nbsp;  (=
(#\space #\tab #\Newline)<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp=
; &nbsp;  (loop (-fx i 1)))<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nb=
sp; &nbsp;  (else<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp; &nbsp;=
  (set! key (substring key 0 (+ i 1))))))<br></div><div dir=3D"ltr">&gt;&nb=
sp; &nbsp; &nbsp;  (cons (string-&gt;symbol (decoder key)) (decoder val))))=
<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp;  ((: id)<br></div><div =
dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp;  (let* ((key (decoder (the-string))))<=
br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp;  (cons (string-&gt;symbo=
l key) key)))<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp;  ((or "/&g=
t;" "&gt;")<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp;  (the-symbol=
))<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp;  (else<br></div><div =
dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp;  (let ((c (the-failure)))<br></div><di=
v dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp;  (if (not (eof-object? c))<br></div>=
<div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  (xml-parse-error "=
Illegal attribute character"<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &n=
bsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  (error-line c (the-port))<b=
r></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbs=
p; &nbsp; &nbsp;  (input-port-name (the-port))<br></div><div dir=3D"ltr">&g=
t;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  (input-po=
rt-position (the-port)))<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp;=
 &nbsp; &nbsp;  (xml-parse-error<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp=
; &nbsp; &nbsp; &nbsp;  (format "Premature end of line, expecting tag `~a'"=
 tag)<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  c<b=
r></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  (input-por=
t-name (the-port))<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp; &nbsp=
; &nbsp;  (-fx (input-port-position (the-port)) 1)))))))<br></div><div dir=
=3D"ltr">&gt;<br></div><div dir=3D"ltr">&gt; ;*----------------------------=
-----------------------------------------*/<br></div><div dir=3D"ltr">&gt; =
;*&nbsp; &nbsp; cdata-grammar ...&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; =
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp=
; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; */<br></div><div dir=3D"=
ltr">&gt; ;*---------------------------------------------------------------=
------*/<br></div><div dir=3D"ltr">&gt; (define cdata-grammar<br></div><div=
 dir=3D"ltr">&gt;&nbsp;  (regular-grammar (decoder)<br></div><div dir=3D"lt=
r">&gt;&nbsp; &nbsp; &nbsp;  ((* (out "]"))<br></div><div dir=3D"ltr">&gt;&=
nbsp; &nbsp; &nbsp;  (let* ((res (decoder (the-string)))<br></div><div dir=
=3D"ltr">&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  (rest (ignore)))<br></div>=
<div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp;  (string-append res rest)))<br></=
div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp;  ("]"<br></div><div dir=3D"lt=
r">&gt;&nbsp; &nbsp; &nbsp;  (string-append "]" (ignore)))<br></div><div di=
r=3D"ltr">&gt;&nbsp; &nbsp; &nbsp;  ((: "]]&gt;" (? "\n"))<br></div><div di=
r=3D"ltr">&gt;&nbsp; &nbsp; &nbsp;  "")<br></div><div dir=3D"ltr">&gt;&nbsp=
; &nbsp; &nbsp;  (else<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp;  =
(let* ((c (the-failure))<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp;=
 &nbsp; &nbsp;  (msg (if (not (eof-object? c))<br></div><div dir=3D"ltr">&g=
t;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  "Illegal &lt;![CDATA[ c=
haracter"<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; =
&nbsp; &nbsp;  "Premature end of line, expecting tag `]]&gt;'")))<br></div>=
<div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp;  (xml-parse-error msg<br></div><d=
iv dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  c<br><=
/div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; =
 (input-port-name (the-port))<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &=
nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  (input-port-position (the-port)))))))<br=
></div><div dir=3D"ltr">&gt;<br></div><div dir=3D"ltr">&gt; ;*-------------=
--------------------------------------------------------*/<br></div><div di=
r=3D"ltr">&gt; ;*&nbsp; &nbsp; get-decoder ...&nbsp; &nbsp; &nbsp; &nbsp; &=
nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;=
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; */<b=
r></div><div dir=3D"ltr">&gt; ;*-------------------------------------------=
--------------------------*/<br></div><div dir=3D"ltr">&gt; (define (get-de=
coder::procedure enc::bstring dst-enc)<br></div><div dir=3D"ltr">&gt;&nbsp;=
  (let ((src-enc (string-&gt;symbol (string-upcase enc))))<br></div><div di=
r=3D"ltr">&gt;&nbsp; &nbsp; &nbsp;  (cond<br></div><div dir=3D"ltr">&gt;&nb=
sp; &nbsp;  ((or (not src-enc) (eq? src-enc dst-enc))<br></div><div dir=3D"=
ltr">&gt;&nbsp; &nbsp; &nbsp;  (lambda (x) x))<br></div><div dir=3D"ltr">&g=
t;&nbsp; &nbsp;  ((eq? src-enc 'UTF-8)<br></div><div dir=3D"ltr">&gt;&nbsp;=
 &nbsp; &nbsp;  (cond<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp; &n=
bsp;  ((memq dst-enc '(ISO-8859-1 ISO-8859-2 ISO-8859-15))<br></div><div di=
r=3D"ltr">&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  utf8-&gt;iso-latin)<br></=
div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp; &nbsp;  ((eq? dst-enc 'UCS-2)=
<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  utf8-str=
ing-&gt;ucs2-string)<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp; &nb=
sp;  (else<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;=
  (lambda (x) x))))<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp;  ((memq src=
-enc '(ISO-8859-1 ISO-8859-2 ISO-8859-15))<br></div><div dir=3D"ltr">&gt;&n=
bsp; &nbsp; &nbsp;  (cond<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp=
; &nbsp;  ((eq? dst-enc 'UTF-8)<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp;=
 &nbsp; &nbsp; &nbsp;  iso-latin-&gt;utf8)<br></div><div dir=3D"ltr">&gt;&n=
bsp; &nbsp; &nbsp; &nbsp;  ((eq? dst-enc 'UCS-2)<br></div><div dir=3D"ltr">=
&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  (lambda (x)<br></div><div dir=3D"lt=
r">&gt;&nbsp; &nbsp; &nbsp; &nbsp;  (utf8-string-&gt;ucs2-string (iso-latin=
-&gt;utf8 x))))<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp; &nbsp;  =
(else<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  (la=
mbda (x) x))))<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp;  (else<br></div>=
<div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp;  (lambda (x) x)))))<br></div><div=
 dir=3D"ltr">&gt;<br></div><div dir=3D"ltr">&gt; ;*------------------------=
---------------------------------------------*/<br></div><div dir=3D"ltr">&=
gt; ;*&nbsp; &nbsp; xml-grammar ...&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp=
; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nb=
sp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; */<br></div><di=
v dir=3D"ltr">&gt; ;*------------------------------------------------------=
---------------*/<br></div><div dir=3D"ltr">&gt; (define xml-grammar<br></d=
iv><div dir=3D"ltr">&gt;&nbsp;  (regular-grammar ((id (: (in ("azAZ") "!?")=
 (* (in ("azAZ09") ":_-"))))<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &n=
bsp; &nbsp; &nbsp; &nbsp;  next<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp;=
 &nbsp; &nbsp; &nbsp; &nbsp;  make<br></div><div dir=3D"ltr">&gt;&nbsp; &nb=
sp; &nbsp; &nbsp; &nbsp; &nbsp;  specials<br></div><div dir=3D"ltr">&gt;&nb=
sp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  strict<br></div><div dir=3D"ltr">&g=
t;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  co=
ntent-pos<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; =
&nbsp;  decoder<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp; &nbsp; &=
nbsp; &nbsp;  encoding<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp; &=
nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  pos)<br></div><div dir=3D"=
ltr">&gt;<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp;  (define (upda=
te-start-position!)<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp;  (se=
t! pos (input-port-position (the-port))))<br></div><div dir=3D"ltr">&gt;<br=
></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp;  (define (ignore-w/-pos-up=
date!)<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp;  (update-start-po=
sition!)<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp;  (ignore))<br><=
/div><div dir=3D"ltr">&gt;<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbs=
p;  ((+ (in " \t\n\r"))<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp; =
 (update-start-position!)<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp=
;  (if content-pos<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp; &nbsp=
; &nbsp;  (list (the-string) (- pos (the-length)))<br></div><div dir=3D"ltr=
">&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  (the-string)))<br></div><div dir=
=3D"ltr">&gt;&nbsp; &nbsp; &nbsp;  ((: "&lt;!--"<br></div><div dir=3D"ltr">=
&gt;&nbsp; &nbsp; &nbsp;  (* (or (out "-") (: "-" (out "-")) (: "--" (out "=
&gt;"))))<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp;  "--&gt;")<br>=
</div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp;  (update-start-position!)<b=
r></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp;  (cons 'comment (the-stri=
ng)))<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp;  ((: "&lt;!" (: (o=
r (out "[-") (: "-" (out "-")))<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp;=
 &nbsp; &nbsp; &nbsp;  (* (out "&gt;]"))<br></div><div dir=3D"ltr">&gt;&nbs=
p; &nbsp; &nbsp; &nbsp; &nbsp;  (? (: "[" (* (out "]")) "]"))<br></div><div=
 dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  (* (out "&gt;"))) "&gt=
;")<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp;  (update-start-posit=
ion!)<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp;  (cons 'declaratio=
n (the-string)))<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp;  ("&lt;=
![CDATA["<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp;  (let ((cdata =
(read/rp cdata-grammar (the-port) decoder)))<br></div><div dir=3D"ltr">&gt;=
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  (update-start-position!)<br></div><div =
dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  (cons 'cdata cdata)))<b=
r></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp;  ((: "&lt;?xml " (* (out =
"?&gt;")) "?&gt;")<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp;  (let=
 ((s (the-substring 6 (the-length))))<br></div><div dir=3D"ltr">&gt;&nbsp; =
&nbsp; &nbsp;  (string-set! s (-fx (string-length s) 2) #\space)<br></div><=
div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp;  (let ((p (open-input-string s)))<=
br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp; &nbsp;  (let loop ((attr=
 '()))<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp; &nbsp;  (let ((ob=
j (read/rp attribute-grammar p 'xml #t decoder)))<br></div><div dir=3D"ltr"=
>&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  (cond<br></div><div dir=3D"ltr">&g=
t;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  ((pair? obj)<br></div><=
div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  (loop=
 (cons obj attr)))<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp; &nbsp=
; &nbsp; &nbsp; &nbsp;  ((eq? obj '&gt;)<br></div><div dir=3D"ltr">&gt;&nbs=
p; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  (=
update-start-position!)<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp; =
&nbsp; &nbsp; &nbsp; &nbsp;  (cons 'xml-decl attr))))))))<br></div><div dir=
=3D"ltr">&gt;&nbsp; &nbsp; &nbsp;  ((: "&lt;?" (* (out "&gt;")) "&gt;")<br>=
</div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp;  (update-start-position!)<b=
r></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp;  (cons 'instruction (the-=
string)))<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp;  ((: "&lt;" id=
 "&gt;")<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp;  (let* ((t (the=
-substring 1 (-fx (the-length) 1)))<br></div><div dir=3D"ltr">&gt;&nbsp; &n=
bsp; &nbsp; &nbsp; &nbsp;  (ts (string-&gt;symbol t))<br></div><div dir=3D"=
ltr">&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  (p (the-port)))<br></div><div =
dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp;  (let ((element (collect-up-to pos ign=
ore-w/-pos-update! ts '() p make specials strict content-pos decoder encodi=
ng)))<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbs=
p;  (update-start-position!)<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &n=
bsp; &nbsp; &nbsp; &nbsp;  element)))<br></div><div dir=3D"ltr">&gt;&nbsp; =
&nbsp; &nbsp;  ((: "&lt;" id "/&gt;")<br></div><div dir=3D"ltr">&gt;&nbsp; =
&nbsp; &nbsp;  (let ((t (the-substring 1 (-fx (the-length) 2))))<br></div><=
div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  (let ((p pos))<br><=
/div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  (updat=
e-start-position!)<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp; &nbsp=
; &nbsp; &nbsp;  (make (string-&gt;symbol t) '() '() p))))<br></div><div di=
r=3D"ltr">&gt;&nbsp; &nbsp; &nbsp;  ((: "&lt;" id (in " \n\t\r"))<br></div>=
<div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp;  (let* ((t (the-substring 1 (-fx =
(the-length) 1)))<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp; &nbsp;=
 &nbsp;  (ts (string-&gt;symbol t))<br></div><div dir=3D"ltr">&gt;&nbsp; &n=
bsp; &nbsp; &nbsp; &nbsp;  (p (the-port)))<br></div><div dir=3D"ltr">&gt;&n=
bsp; &nbsp; &nbsp;  (let loop ((attr '()))<br></div><div dir=3D"ltr">&gt;&n=
bsp; &nbsp; &nbsp; &nbsp;  (let ((obj (read/rp attribute-grammar p t strict=
 decoder)))<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp; &nbsp;  (con=
d<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  ((pair?=
 obj)<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbs=
p;  (loop (cons obj attr)))<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nb=
sp; &nbsp; &nbsp;  ((eq? obj '&gt;)<br></div><div dir=3D"ltr">&gt;&nbsp; &n=
bsp; &nbsp; &nbsp; &nbsp; &nbsp;  (let ((element (collect-up-to pos ignore-=
w/-pos-update! ts (reverse! attr) p make specials strict content-pos decode=
r encoding)))<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nb=
sp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  (update-start-position!)<br>=
</div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;=
 &nbsp; &nbsp; &nbsp; &nbsp;  element))<br></div><div dir=3D"ltr">&gt;&nbsp=
; &nbsp; &nbsp; &nbsp; &nbsp;  ((eq? obj '/&gt;)<br></div><div dir=3D"ltr">=
&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  =
(let ((p pos))<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp; &nbsp; &n=
bsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  (update-start-position!)<br=
></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp=
; &nbsp; &nbsp; &nbsp; &nbsp;  (make ts (reverse! attr) '() p))))))))<br></=
div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp;  ((: "&lt;/" id "&gt;")<br></=
div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp;  (update-start-position!)<br>=
</div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp;  (string-&gt;symbol (the-su=
bstring 2 (-fx (the-length) 1))))<br></div><div dir=3D"ltr">&gt;&nbsp; &nbs=
p; &nbsp;  ((+ (out "&lt;"))<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &n=
bsp;  (update-start-position!)<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; =
&nbsp;  (if content-pos<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp; =
&nbsp; &nbsp;  (let ((pos2 (- pos (the-length))))<br></div><div dir=3D"ltr"=
>&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  (list (decoder (the-string)=
) pos2))<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  =
(decoder (the-string))))<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp;=
  (else<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp;  (let ((c (the-f=
ailure)))<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp;  (cond<br></di=
v><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp; &nbsp;  ((not (eof-object? c))<=
br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  (xml-pars=
e-error "Illegal character"<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nb=
sp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  (error-line c (the-port))<br=
></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp=
; &nbsp; &nbsp;  (input-port-name (the-port))<br></div><div dir=3D"ltr">&gt=
;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  (input-por=
t-position (the-port))))<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp;=
 &nbsp;  (else<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp; &nbsp; &n=
bsp;  c))))))<br></div><div dir=3D"ltr">&gt;<br></div><div dir=3D"ltr">&gt;=
 ;*---------------------------------------------------------------------*/<=
br></div><div dir=3D"ltr">&gt; ;*&nbsp; &nbsp; char-hexnumeric? ...&nbsp; &=
nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;=
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; */<b=
r></div><div dir=3D"ltr">&gt; ;*-------------------------------------------=
--------------------------*/<br></div><div dir=3D"ltr">&gt; (define (char-h=
exnumeric? c)<br></div><div dir=3D"ltr">&gt;&nbsp;  (or (char-numeric? c)<b=
r></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp;  (and (char&gt;=3D? c #\A=
) (char&lt;=3D? c #\F))<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp; =
 (and (char&gt;=3D? c #\a) (char&lt;=3D? c #\f))))<br></div><div dir=3D"ltr=
">&gt;<br></div><div dir=3D"ltr">&gt; ;*-----------------------------------=
----------------------------------*/<br></div><div dir=3D"ltr">&gt; ;*&nbsp=
; &nbsp; xml-string-decode-inner! ...&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nb=
sp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &=
nbsp; &nbsp; */<br></div><div dir=3D"ltr">&gt; ;*--------------------------=
-------------------------------------------*/<br></div><div dir=3D"ltr">&gt=
; (define (xml-string-decode-inner! str ol nl res)<br></div><div dir=3D"ltr=
">&gt;&nbsp;  (define (char-value c)<br></div><div dir=3D"ltr">&gt;&nbsp; &=
nbsp; &nbsp;  (cond<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp;  ((char-num=
eric? c)<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp;  (-fx (char-&gt=
;integer c) (char-&gt;integer #\0)))<br></div><div dir=3D"ltr">&gt;&nbsp; &=
nbsp;  ((char&lt;=3D? c #\F)<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &n=
bsp;  (+fx 10 (-fx (char-&gt;integer c) (char-&gt;integer #\A))))<br></div>=
<div dir=3D"ltr">&gt;&nbsp; &nbsp;  (else<br></div><div dir=3D"ltr">&gt;&nb=
sp; &nbsp; &nbsp;  (+fx 10 (-fx (char-&gt;integer c) (char-&gt;integer #\a)=
)))))<br></div><div dir=3D"ltr">&gt;&nbsp;  (let ((ol-2 (-fx ol 2)))<br></d=
iv><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp;  (let loop ((i 0)<br></div><di=
v dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp; &nbsp;  (j 0))<br></div><div dir=3D"=
ltr">&gt;&nbsp; &nbsp;  (if (=3Dfx j nl)<br></div><div dir=3D"ltr">&gt;&nbs=
p; &nbsp; &nbsp; &nbsp;  res<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &n=
bsp; &nbsp;  (let ((c (string-ref str i)))<br></div><div dir=3D"ltr">&gt;&n=
bsp; &nbsp; &nbsp; &nbsp;  (if (and (char=3D? c #\%) (&lt;fx i ol-2))<br></=
div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  (let ((=
c1 (string-ref str (+fx i 1)))<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; =
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  (c2 (string-ref str (+fx i 2))))<br></d=
iv><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  (=
if (and (char-hexnumeric? c1) (char-hexnumeric? c2))<br></div><div dir=3D"l=
tr">&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  (let* ((v1 (char-=
value c1))<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;=
 &nbsp; &nbsp; &nbsp; &nbsp;  (v2 (char-value c2))<br></div><div dir=3D"ltr=
">&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  (d (i=
nteger-&gt;char (+fx (*fx v1 16) v2))))<br></div><div dir=3D"ltr">&gt;&nbsp=
; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  (string-set! res=
 j d)<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbs=
p; &nbsp; &nbsp; &nbsp;  (loop (+fx i 3) (+fx j 1)))<br></div><div dir=3D"l=
tr">&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  (begin<br></div><=
div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;=
 &nbsp;  (string-set! res j c)<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; =
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  (loop (+fx i 1) (+fx j 1)=
))))<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp=
;  (begin<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; =
&nbsp; &nbsp;  (string-set! res j c)<br></div><div dir=3D"ltr">&gt;&nbsp; &=
nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  (loop (+fx i 1) (+fx j 1)))))))))=
<br></div><div dir=3D"ltr">&gt;<br></div><div dir=3D"ltr">&gt; ;*----------=
-----------------------------------------------------------*/<br></div><div=
 dir=3D"ltr">&gt; ;*&nbsp; &nbsp; xml-count ...&nbsp; &nbsp; &nbsp; &nbsp; =
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp=
; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nb=
sp; */<br></div><div dir=3D"ltr">&gt; ;*-----------------------------------=
----------------------------------*/<br></div><div dir=3D"ltr">&gt; (define=
 (xml-count str ol)<br></div><div dir=3D"ltr">&gt;&nbsp;  (let loop ((i 0)<=
br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  (c 0))<br=
></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp;  (cond<br></div><div dir=
=3D"ltr">&gt;&nbsp; &nbsp;  ((=3Dfx i ol)<br></div><div dir=3D"ltr">&gt;&nb=
sp; &nbsp; &nbsp;  c)<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp;  ((char=
=3D? (string-ref str i) #\&amp;)<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp=
; &nbsp;  (cond<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp; &nbsp;  =
((substring-at? str "&amp;lt;" i)<br></div><div dir=3D"ltr">&gt;&nbsp; &nbs=
p; &nbsp; &nbsp; &nbsp;  (loop (+fx i 4) (+fx c 1)))<br></div><div dir=3D"l=
tr">&gt;&nbsp; &nbsp; &nbsp; &nbsp;  ((substring-at? str "&amp;gt;" i)<br><=
/div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  (loop (+fx i =
4) (+fx c 1)))<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp; &nbsp;  (=
(substring-at? str "&amp;amp;" i)<br></div><div dir=3D"ltr">&gt;&nbsp; &nbs=
p; &nbsp; &nbsp; &nbsp;  (loop (+fx i 5) (+fx c 1)))<br></div><div dir=3D"l=
tr">&gt;&nbsp; &nbsp; &nbsp; &nbsp;  ((substring-at? str "&amp;quot;" i)<br=
></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  (loop (+fx =
i 6) (+fx c 1)))<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp; &nbsp; =
 ((substring-at? str "&amp;nbsp;" i)<br></div><div dir=3D"ltr">&gt;&nbsp; &=
nbsp; &nbsp; &nbsp; &nbsp;  (loop (+fx i 6) (+fx c 1)))<br></div><div dir=
=3D"ltr">&gt;&nbsp; &nbsp; &nbsp; &nbsp;  ((substring-at? str "&amp;#" i)<b=
r></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  (let liip =
((i (+fx i 2)))<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp; &nbsp;  =
(cond<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbs=
p;  ((=3Dfx i ol)<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp; &nbsp;=
 &nbsp; &nbsp;  c)<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp; &nbsp=
; &nbsp; &nbsp;  ((char-numeric? (string-ref str i))<br></div><div dir=3D"l=
tr">&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  (liip (+fx i 1)))<br></d=
iv><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  (else<br=
></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  (loo=
p (+fx i 1) (+fx c 1))))))<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbs=
p; &nbsp;  (else<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp; &nbsp; =
&nbsp;  (loop (+fx i 1) (+fx c 1)))))<br></div><div dir=3D"ltr">&gt;&nbsp; =
&nbsp;  (else<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp;  (loop (+f=
x i 1) (+fx c 1))))))<br></div><div dir=3D"ltr">&gt;<br></div><div dir=3D"l=
tr">&gt; ;*----------------------------------------------------------------=
-----*/<br></div><div dir=3D"ltr">&gt; ;*&nbsp; &nbsp; xml-decode ...&nbsp;=
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbs=
p; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &n=
bsp; &nbsp; &nbsp; */<br></div><div dir=3D"ltr">&gt; ;*--------------------=
-------------------------------------------------*/<br></div><div dir=3D"lt=
r">&gt; (define (xml-decode! str res ol nl)<br></div><div dir=3D"ltr">&gt;&=
nbsp;  (let loop ((i 0)<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp; =
&nbsp; &nbsp;  (j 0))<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp;  (=
cond<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp;  ((=3Dfx i ol)<br></div><d=
iv dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp;  res)<br></div><div dir=3D"ltr">&gt=
;&nbsp; &nbsp;  ((char=3D? (string-ref str i) #\&amp;)<br></div><div dir=3D=
"ltr">&gt;&nbsp; &nbsp; &nbsp;  (cond<br></div><div dir=3D"ltr">&gt;&nbsp; =
&nbsp; &nbsp; &nbsp;  ((substring-at? str "&amp;lt;" i)<br></div><div dir=
=3D"ltr">&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  (string-set! res j #\&lt;)=
<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  (loop (+=
fx i 4) (+fx j 1)))<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp; &nbs=
p;  ((substring-at? str "&amp;gt;" i)<br></div><div dir=3D"ltr">&gt;&nbsp; =
&nbsp; &nbsp; &nbsp; &nbsp;  (string-set! res j #\&gt;)<br></div><div dir=
=3D"ltr">&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  (loop (+fx i 4) (+fx j 1))=
)<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp; &nbsp;  ((substring-at=
? str "&amp;amp;" i)<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp; &nb=
sp; &nbsp;  (string-set! res j #\&amp;)<br></div><div dir=3D"ltr">&gt;&nbsp=
; &nbsp; &nbsp; &nbsp; &nbsp;  (loop (+fx i 5) (+fx j 1)))<br></div><div di=
r=3D"ltr">&gt;&nbsp; &nbsp; &nbsp; &nbsp;  ((substring-at? str "&amp;quot;"=
 i)<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  (stri=
ng-set! res j #\")<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp; &nbsp=
; &nbsp;  (loop (+fx i 6) (+fx j 1)))<br></div><div dir=3D"ltr">&gt;&nbsp; =
&nbsp; &nbsp; &nbsp;  ((substring-at? str "&amp;nbsp;" i)<br></div><div dir=
=3D"ltr">&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  (string-set! res j #\space=
)<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  (loop (=
+fx i 6) (+fx j 1)))<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp; &nb=
sp;  ((substring-at? str "&amp;#" i)<br></div><div dir=3D"ltr">&gt;&nbsp; &=
nbsp; &nbsp; &nbsp; &nbsp;  (let liip ((i (+fx i 2))<br></div><div dir=3D"l=
tr">&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  (n 0))<br></div><div dir=
=3D"ltr">&gt;&nbsp; &nbsp; &nbsp; &nbsp;  (if (=3Dfx i ol)<br></div><div di=
r=3D"ltr">&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  res<br></div><div =
dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  (let ((c (string=
-ref str i)))<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nb=
sp; &nbsp;  (if (char-numeric? c)<br></div><div dir=3D"ltr">&gt;&nbsp; &nbs=
p; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  (liip (+fx i 1)<br></div><div=
 dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &n=
bsp;  (+fx (*fx n 10)<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp; &n=
bsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  (-fx (char-&gt;integer c)<br></div=
><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbs=
p; &nbsp; &nbsp;  (char-&gt;integer #\0))))<br></div><div dir=3D"ltr">&gt;&=
nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  (begin<br></div><di=
v dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &=
nbsp;  (string-set! res j (integer-&gt;char n))<br></div><div dir=3D"ltr">&=
gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  (loop (+=
fx i 1) (+fx j 1))))))))<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp;=
 &nbsp;  (else<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp; &nbsp; &n=
bsp;  (string-set! res j (string-ref str i))<br></div><div dir=3D"ltr">&gt;=
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  (loop (+fx i 1) (+fx j 1)))))<br></div>=
<div dir=3D"ltr">&gt;&nbsp; &nbsp;  (else<br></div><div dir=3D"ltr">&gt;&nb=
sp; &nbsp; &nbsp;  (string-set! res j (string-ref str i))<br></div><div dir=
=3D"ltr">&gt;&nbsp; &nbsp; &nbsp;  (loop (+fx i 1) (+fx j 1))))))<br></div>=
<div dir=3D"ltr">&gt;<br></div><div dir=3D"ltr">&gt; ;*--------------------=
-------------------------------------------------*/<br></div><div dir=3D"lt=
r">&gt; ;*&nbsp; &nbsp; xml-string-decode ...&nbsp; &nbsp; &nbsp; &nbsp; &n=
bsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; =
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; */<br></div><div dir=3D"lt=
r">&gt; ;*-----------------------------------------------------------------=
----*/<br></div><div dir=3D"ltr">&gt; (define (xml-string-decode str)<br></=
div><div dir=3D"ltr">&gt;&nbsp;  (let ((ol (string-length str)))<br></div><=
div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp;  (if (&gt;=3Dfx ol 3)<br></div><di=
v dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp;  (let ((nl (xml-count str ol)))<br><=
/div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp; &nbsp;  (if (=3Dfx nl ol)<br=
></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp; &nbsp;  (string-copy str)<=
br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp; &nbsp;  (let ((res (make=
-string nl)))<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nb=
sp; &nbsp;  (xml-decode! str res ol nl)<br></div><div dir=3D"ltr">&gt;&nbsp=
; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  res)))<br></div><div dir=3D"ltr">&gt;=
&nbsp; &nbsp; &nbsp;  (string-copy str))))<br></div><div dir=3D"ltr">&gt;<b=
r></div><div dir=3D"ltr">&gt; ;*-------------------------------------------=
--------------------------*/<br></div><div dir=3D"ltr">&gt; ;*&nbsp; &nbsp;=
 xml-string-decode! ...&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nb=
sp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &=
nbsp; &nbsp; &nbsp; */<br></div><div dir=3D"ltr">&gt; ;*-------------------=
--------------------------------------------------*/<br></div><div dir=3D"l=
tr">&gt; (define (xml-string-decode! str)<br></div><div dir=3D"ltr">&gt;&nb=
sp;  (let ((ol (string-length str)))<br></div><div dir=3D"ltr">&gt;&nbsp; &=
nbsp; &nbsp;  (if (&gt;=3Dfx ol 3)<br></div><div dir=3D"ltr">&gt;&nbsp; &nb=
sp; &nbsp;  (let ((nl (xml-count str ol)))<br></div><div dir=3D"ltr">&gt;&n=
bsp; &nbsp; &nbsp; &nbsp;  (if (=3Dfx nl ol)<br></div><div dir=3D"ltr">&gt;=
&nbsp; &nbsp; &nbsp; &nbsp;  str<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp=
; &nbsp; &nbsp;  (begin<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp; =
&nbsp; &nbsp; &nbsp;  (xml-decode! str str ol nl)<br></div><div dir=3D"ltr"=
>&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  (string-shrink! str nl))))<=
br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp;  str)))<br></div><div di=
r=3D"ltr">&gt;<br></div><div dir=3D"ltr">&gt; ;*---------------------------=
------------------------------------------*/<br></div><div dir=3D"ltr">&gt;=
 ;*&nbsp; &nbsp; xml-string-encode ...&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &n=
bsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; =
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; */<br></div><div dir=3D"ltr">&gt;=
 ;*---------------------------------------------------------------------*/<=
br></div><div dir=3D"ltr">&gt; (define (xml-string-encode str)<br></div><di=
v dir=3D"ltr">&gt;&nbsp;  (define (count str ol)<br></div><div dir=3D"ltr">=
&gt;&nbsp; &nbsp; &nbsp;  (let loop ((i 0)<br></div><div dir=3D"ltr">&gt;&n=
bsp; &nbsp; &nbsp; &nbsp;  (n 0))<br></div><div dir=3D"ltr">&gt;&nbsp; &nbs=
p;  (if (=3Dfx i ol)<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp; &nb=
sp;  n<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp; &nbsp;  (let ((c =
(string-ref str i)))<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp; &nb=
sp;  (case c<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbs=
p;  ((#\")<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;=
 &nbsp;  (loop (+fx i 1) (+fx n 6)))<br></div><div dir=3D"ltr">&gt;&nbsp; &=
nbsp; &nbsp; &nbsp; &nbsp;  ((#\&amp;)<br></div><div dir=3D"ltr">&gt;&nbsp;=
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  (loop (+fx i 1) (+fx n 5)))<br></div><=
div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  ((#\&lt; #\&gt;)<br=
></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  (loo=
p (+fx i 1) (+fx n 4)))<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp; =
&nbsp; &nbsp;  (else<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp; &nb=
sp; &nbsp; &nbsp;  (loop (+fx i 1) (+fx n 1))))))))<br></div><div dir=3D"lt=
r">&gt;&nbsp;  (define (encode str ol nl)<br></div><div dir=3D"ltr">&gt;&nb=
sp; &nbsp; &nbsp;  (if (=3Dfx nl ol)<br></div><div dir=3D"ltr">&gt;&nbsp; &=
nbsp; &nbsp;  str<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp;  (let =
((res (make-string nl)))<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp;=
 &nbsp;  (let loop ((i 0)<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp=
; &nbsp; &nbsp; &nbsp;  (j 0))<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; =
&nbsp; &nbsp;  (if (=3Dfx j nl)<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp;=
 &nbsp; &nbsp; &nbsp; &nbsp;  res<br></div><div dir=3D"ltr">&gt;&nbsp; &nbs=
p; &nbsp; &nbsp; &nbsp; &nbsp;  (let ((c (string-ref str i)))<br></div><div=
 dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  (case c<=
br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nb=
sp;  ((#\&lt;)<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp; &nbsp; &n=
bsp; &nbsp; &nbsp;  (blit-string! "&amp;lt;" 0 res j 4)<br></div><div dir=
=3D"ltr">&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  (loop (+fx i=
 1) (+fx j 4)))<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp; &nbsp; &=
nbsp; &nbsp; &nbsp;  ((#\&gt;)<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; =
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  (blit-string! "&amp;gt;" 0 res j 4)<br>=
</div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;=
  (loop (+fx i 1) (+fx j 4)))<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &=
nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  ((#\&amp;)<br></div><div dir=3D"ltr">&gt=
;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  (blit-string! "&amp;amp;=
" 0 res j 5)<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbs=
p; &nbsp; &nbsp;  (loop (+fx i 1) (+fx j 5)))<br></div><div dir=3D"ltr">&gt=
;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  ((#\")<br></div><div dir=
=3D"ltr">&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  (blit-string=
! "&amp;quot;" 0 res j 6)<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp=
; &nbsp; &nbsp; &nbsp; &nbsp;  (loop (+fx i 1) (+fx j 6)))<br></div><div di=
r=3D"ltr">&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  (else<br></=
div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  =
(string-set! res j c)<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp; &n=
bsp; &nbsp; &nbsp; &nbsp;  (loop (+fx i 1) (+fx j 1))))))))))<br></div><div=
 dir=3D"ltr">&gt;&nbsp;  (let ((ol (string-length str)))<br></div><div dir=
=3D"ltr">&gt;&nbsp; &nbsp; &nbsp;  (encode str ol (count str ol))))<br></di=
v><div dir=3D"ltr">&gt;<br></div><div dir=3D"ltr">&gt; ;*------------------=
---------------------------------------------------*/<br></div><div dir=3D"=
ltr">&gt; ;*&nbsp; &nbsp; read-xml ...&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &n=
bsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; =
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; */<br=
></div><div dir=3D"ltr">&gt; ;*--------------------------------------------=
-------------------------*/<br></div><div dir=3D"ltr">&gt; (define (read-xm=
l #!optional (port::input-port (current-input-port)))<br></div><div dir=3D"=
ltr">&gt;&nbsp;  (xml-parse port))<br></div><div dir=3D"ltr">&gt;<br></div>=
<div dir=3D"ltr">&gt; ;*---------------------------------------------------=
------------------*/<br></div><div dir=3D"ltr">&gt; ;*&nbsp; &nbsp; xml-met=
adata ...&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nb=
sp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &=
nbsp; &nbsp; &nbsp; &nbsp; */<br></div><div dir=3D"ltr">&gt; ;*------------=
---------------------------------------------------------*/<br></div><div d=
ir=3D"ltr">&gt; (define (xml-metadata xml)<br></div><div dir=3D"ltr">&gt;&n=
bsp;  (let ((xml-ver #f)<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp;  (xml-=
enc #f)<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp;  (xml-lang #f)<br></div=
><div dir=3D"ltr">&gt;&nbsp; &nbsp;  (root-ver 0.0)<br></div><div dir=3D"lt=
r">&gt;&nbsp; &nbsp;  (xml-root #f)<br></div><div dir=3D"ltr">&gt;&nbsp; &n=
bsp;  (xml-ns '()))<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp;  (le=
t loop1 ((l xml))<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp;  (when (pair?=
 l)<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp; &nbsp;  (match-case =
(car l)<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  (=
(xml-decl . (and ?attr (?- . ?-)))<br></div><div dir=3D"ltr">&gt;&nbsp; &nb=
sp; &nbsp; &nbsp;  (for-each (lambda (at)<br></div><div dir=3D"ltr">&gt;&nb=
sp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  (case (car at)<br></d=
iv><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &n=
bsp;  ((version) (set! xml-ver (cdr attr)))<br></div><div dir=3D"ltr">&gt;&=
nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  ((encoding) (set! x=
ml-enc (cdr attr)))))<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp; &n=
bsp; &nbsp; &nbsp; &nbsp;  attr))<br></div><div dir=3D"ltr">&gt;&nbsp; &nbs=
p; &nbsp; &nbsp; &nbsp;  ((?mark ?lattr . ?-)<br></div><div dir=3D"ltr">&gt=
;&nbsp; &nbsp; &nbsp; &nbsp;  (let loop3 ((lattr lattr))<br></div><div dir=
=3D"ltr">&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  (unless xml-root (set! xml=
-root mark))<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbs=
p;  (when (pair? lattr)<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp; =
&nbsp; &nbsp; &nbsp; &nbsp;  (let ((attr (car lattr)))<br></div><div dir=3D=
"ltr">&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  (case (car attr)<br></=
div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &=
nbsp;  ((xml:lang)<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp; &nbsp=
; &nbsp; &nbsp; &nbsp; &nbsp;  (set! xml-lang (cdr attr)))<br></div><div di=
r=3D"ltr">&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  ((xm=
lns)<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp=
; &nbsp; &nbsp;  (set! xml-root (cons (cdr attr) xml-root)))<br></div><div =
dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  ((=
version)<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &=
nbsp; &nbsp; &nbsp;  (set! root-ver (string-&gt;number (cdr attr))))<br></d=
iv><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &n=
bsp;  (else<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp=
; &nbsp; &nbsp; &nbsp;  (let ((str (symbol-&gt;string (car attr))))<br></di=
v><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nb=
sp;  (when (substring=3D? str "xmlns:" 6)<br></div><div dir=3D"ltr">&gt;&nb=
sp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  (let* ((l (str=
ing-length str))<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp; &nbsp; =
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  (s (substring str 6 l))<b=
r></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbs=
p; &nbsp; &nbsp; &nbsp; &nbsp;  (si (string-&gt;symbol s)))<br></div><div d=
ir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbs=
p; &nbsp; &nbsp;  (set! xml-ns<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; =
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  (con=
s (cons (cdr attr) si)<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp; &=
nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  xml-n=
s)))))))<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &=
nbsp;  (loop3 (cdr lattr)))))))<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp;=
 &nbsp; &nbsp;  (loop1 (cdr l))))<br></div><div dir=3D"ltr">&gt;&nbsp; &nbs=
p; &nbsp;  (unless xml-root<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp;  (e=
rror "xml-metadata" "Empty XML document !" xml))<br></div><div dir=3D"ltr">=
&gt;&nbsp; &nbsp; &nbsp;  ;; Values are :<br></div><div dir=3D"ltr">&gt;&nb=
sp; &nbsp; &nbsp;  ;; - XML Version (1.0 or 1.1) or #f<br></div><div dir=3D=
"ltr">&gt;&nbsp; &nbsp; &nbsp;  ;; - XML Encoding (#f if unknown)<br></div>=
<div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp;  ;; - xml:lang value<br></div><di=
v dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp;  ;; - Pair, which car is the first d=
ata markup, and<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp;  ;;&nbsp=
; cdr the default namespace<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nb=
sp;  ;; - xml first data markup version attribute (0 if unspecified)<br></d=
iv><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp;  ;; - list of prefixed namespa=
ces (prefix . path)<br></div><div dir=3D"ltr">&gt;&nbsp; &nbsp; &nbsp;  (va=
lues xml-ver xml-enc xml-lang xml-root root-ver xml-ns)))<br></div></div>
            </div>
        </div></body></html>
------=_Part_2269273_182048361.1644899034175--

------=_Part_2269274_799726553.1644899034192
Content-Type: text/x-scheme
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="=?UTF-8?b?eG1sLnNjbQ==?="
Content-ID: <[email protected]>

Oyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT0qLwo7KiAgICBzZXJyYW5vL3ByZ20vcHJvamVjdC9iaWdsb28vYmlnbG9v
L2FwaS93ZWIvc3JjL0xsaWIveG1sLnNjbSAgICAgICovCjsqICAgIC0tLS0tLS0tLS0tLS0tLS0t
LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gICAgKi8KOyogICAg
QXV0aG9yICAgICAgOiAgTWFudWVsIFNlcnJhbm8gICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAqLwo7KiAgICBDcmVhdGlvbiAgICA6ICBGcmkgTWFyIDExIDE2OjIzOjUzIDIwMDUg
ICAgICAgICAgICAgICAgICAgICAgICAgICovCjsqICAgIExhc3QgY2hhbmdlIDogIFN1biBPY3Qg
IDcgMDg6NDY6MDMgMjAxOCAoc2VycmFubykgICAgICAgICAgICAgICAgKi8KOyogICAgQ29weXJp
Z2h0ICA6ICAyMDA1LTE4IE1hbnVlbCBTZXJyYW5vICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICovCjsqICAgIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t
LS0tLS0tLS0tLS0tLS0gICAgKi8KOyogICAgWE1MIHBhcnNpbmcgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwo7Kj09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCgo7
Ki0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t
LS0tLS0tLS0tLS0tLSovCjsqICAgIFRoZSBtb2R1bGUgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwo7Ki0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t
LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSovCihtb2R1bGUg
X193ZWJfeG1sCgogIChvcHRpb24gKHNldCEgKmRsb3Blbi1pbml0LWdjKiAjdCkpCgogIChleHBv
cnQgKHhtbC1wYXJzZTo6cGFpci1uaWwgcG9ydDo6aW5wdXQtcG9ydAogICAgICAgICAgICAgICAg
IyFrZXkKICAgICAgICAgICAgICAgIChjb250ZW50LWxlbmd0aCAwKQogICAgICAgICAgICAgICAg
KG1ha2UtZWxlbWVudCAobGFtYmRhICh0YWcgYXR0cmlicyBib2R5IHN0YXJ0LXBvcykKICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgKGxpc3QgdGFnIGF0dHJpYnMgYm9keSkpKQogICAg
ICAgICAgICAgICAgKG1ha2UtY29udGVudCAobGFtYmRhIChzdHIgcG9zKSBzdHIpKQogICAgICAg
ICAgICAgICAgKG1ha2UtY29tbWVudCAobGFtYmRhIChzdHIgcG9zKSAoY29ucyAnY29tbWVudCBz
dHIpKSkKICAgICAgICAgICAgICAgIChtYWtlLWRlY2xhcmF0aW9uIChsYW1iZGEgKHN0ciBwb3Mp
IChjb25zICdkZWNsYXJhdGlvbiBzdHIpKSkKICAgICAgICAgICAgICAgIChtYWtlLWNkYXRhIChs
YW1iZGEgKHN0ciBwb3MpIChjb25zICdjZGF0YSBzdHIpKSkKICAgICAgICAgICAgICAgIChtYWtl
LXhtbC1kZWNsYXJhdGlvbiAobGFtYmRhIChhdHRyIHBvcykgKGNvbnMgJ3htbC1kZWNsIGF0dHIp
KSkKICAgICAgICAgICAgICAgIChtYWtlLWluc3RydWN0aW9uIChsYW1iZGEgKHN0ciBwb3MpIChj
b25zICdpbnN0cnVjdGlvbiBzdHIpKSkKICAgICAgICAgICAgICAgIChzcGVjaWFscyAnKCkpCiAg
ICAgICAgICAgICAgICAoc3RyaWN0ICN0KQogICAgICAgICAgICAgICAgKGVuY29kaW5nICdVVEYt
OCkKICAgICAgICAgICAgICAgIChlb2kgI2YpKQogICAgICAoeG1sLXN0cmluZy1kZWNvZGU6OmJz
dHJpbmcgOjpic3RyaW5nKQogICAgICAoeG1sLXN0cmluZy1kZWNvZGUhOjpic3RyaW5nIDo6YnN0
cmluZykKICAgICAgKHhtbC1zdHJpbmctZW5jb2RlOjpic3RyaW5nIDo6YnN0cmluZykKICAgICAg
KHJlYWQteG1sICMhb3B0aW9uYWwgKHBvcnQ6OmlucHV0LXBvcnQgKGN1cnJlbnQtaW5wdXQtcG9y
dCkpKQogICAgICAoeG1sLW1ldGFkYXRhIHhtbC10cmVlOjpwYWlyLW5pbCkpKQoKOyotLS0tLS0t
LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t
LS0tLS0qLwo7KiAgICB4bWwtcGFyc2UgLi4uICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICovCjsqLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t
LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKi8KKGRlZmluZSAoeG1sLXBh
cnNlOjpwYWlyLW5pbCBwb3J0OjppbnB1dC1wb3J0CiAgICAgICAgICAgICAgICAjIWtleQogICAg
ICAgICAgICAgICAgKGNvbnRlbnQtbGVuZ3RoIDApCiAgICAgICAgICAgICAgICAobWFrZS1lbGVt
ZW50IChsYW1iZGEgKHRhZyBhdHRyaWJzIGJvZHkgc3RhcnQtcG9zKQogICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAobGlzdCB0YWcgYXR0cmlicyBib2R5KSkpCiAgICAgICAgICAgICAg
ICAobWFrZS1jb250ZW50IChsYW1iZGEgKHN0ciBwb3MpIHN0cikpCiAgICAgICAgICAgICAgICAo
bWFrZS1jb21tZW50IChsYW1iZGEgKHN0ciBwb3MpIChjb25zICdjb21tZW50IHN0cikpKQogICAg
ICAgICAgICAgICAgKG1ha2UtZGVjbGFyYXRpb24gKGxhbWJkYSAoc3RyIHBvcykgKGNvbnMgJ2Rl
Y2xhcmF0aW9uIHN0cikpKQogICAgICAgICAgICAgICAgKG1ha2UtY2RhdGEgKGxhbWJkYSAoc3Ry
IHBvcykgKGNvbnMgJ2NkYXRhIHN0cikpKQogICAgICAgICAgICAgICAgKG1ha2UteG1sLWRlY2xh
cmF0aW9uIChsYW1iZGEgKGF0dHIgcG9zKSAoY29ucyAneG1sLWRlY2wgYXR0cikpKQogICAgICAg
ICAgICAgICAgKG1ha2UtaW5zdHJ1Y3Rpb24gKGxhbWJkYSAoc3RyIHBvcykgKGNvbnMgJ2luc3Ry
dWN0aW9uIHN0cikpKQogICAgICAgICAgICAgICAgKHNwZWNpYWxzICcoKSkKICAgICAgICAgICAg
ICAgIChzdHJpY3QgI3QpCiAgICAgICAgICAgICAgICAoZW5jb2RpbmcgJ1VURi04KQogICAgICAg
ICAgICAgICA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0tKi8K
KGRlZmluZSAoY29sbGVjdC11cC10byBzdGFydC1wb3MgaWdub3JlIHRhZyBhdHRyaWJ1dGVzIHBv
cnQKICAgICAgICAgICBtYWtlLWVsZW1lbnQgbWFrZS1jb250ZW50IG1ha2UtY29tbWVudCBtYWtl
LWRlY2xhcmF0aW9uCiAgICAgICAgICAgbWFrZS1jZGF0YSBtYWtlLXhtbC1kZWNsYXJhdGlvbiBt
YWtlLWluc3RydWN0aW9uIHNwZWNpYWxzIHN0cmljdCBkZWNvZGVyIGVuY29kaW5nKQogICAKICAo
ZGVmaW5lIChjb2xsZWN0IGlnbm9yZSB0YWdzKQogICAgICAobGV0ICgobmFtZSAoaW5wdXQtcG9y
dC1uYW1lIHBvcnQpKQogICAgICAgIChwbyAoaW5wdXQtcG9ydC1wb3NpdGlvbiBwb3J0KSkpCiAg
ICAobGV0IGxvb3AgKChhY2MgJygpKQogICAgICAgICAgICAoaXRlbSAoaWdub3JlKSkpCiAgICAg
ICAgKGNvbmQKICAgICAgICAgICgoc3ltYm9sPyBpdGVtKQogICAgICAgIChjb25kCiAgICAgICAg
ICAoKGVxPyBpdGVtIHRhZykKICAgICAgICAgICAgKG1ha2UtZWxlbWVudCB0YWcgYXR0cmlidXRl
cyAocmV2ZXJzZSEgYWNjKSBzdGFydC1wb3MpKQogICAgICAgICAgKHN0cmljdAogICAgICAgICAg
ICAoeG1sLXBhcnNlLWVycm9yICJJbGxlZ2FsIGNsb3NpbmcgdGFnIgogICAgICAgICAgICAgIChm
b3JtYXQgImB+YScgZXhwZWN0ZWQsIGB+YScgcHJvdmlkZWQiCiAgICAgICAgICAgICAgdGFnIGl0
ZW0pCiAgICAgICAgICAgICAgbmFtZSBwbykpCiAgICAgICAgICAoZWxzZQogICAgICAgICAgICAo
bWFrZS1lbGVtZW50IHRhZyBhdHRyaWJ1dGVzIChyZXZlcnNlISBhY2MpIHN0YXJ0LXBvcykpKSkK
ICAgICAgICAgICgoc3BlY2lhbD8gaXRlbSkKICAgICAgICAobGV0ICgobml0ZW0gKG1ha2UtZWxl
bWVudCAoc3BlY2lhbC10YWcgaXRlbSkKICAgICAgICAgICAgICAgIChzcGVjaWFsLWF0dHJpYnV0
ZXMgaXRlbSkKICAgICAgICAgICAgICAgIChzcGVjaWFsLWJvZHkgaXRlbSkKICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICBzdGFydC1wb3MpKSkKICAgICAgICAgIChpZiAobWVtcSAoc3Bl
Y2lhbC10YWcgaXRlbSkgdGFncykKICAgICAgICAgICAgICAobG9vcCBhY2Mgbml0ZW0pCiAgICAg
ICAgICAgICAgKGxpc3QgKG1ha2UtZWxlbWVudCB0YWcgYXR0cmlidXRlcyAocmV2ZXJzZSEgYWNj
KSBzdGFydC1wb3MpIG5pdGVtKSkpKQogICAgICAgICAgKChlb2Ytb2JqZWN0PyBpdGVtKQogICAg
ICAgIChpZiBzdHJpY3QKICAgICAgICAgICAgKHhtbC1wYXJzZS1lcnJvcgogICAgICAgICAgICAg
IChmb3JtYXQgIlByZW1hdHVyZSBlbmQgb2YgbGluZSwgZXhwZWN0aW5nIHRhZyBgfmEnIgogICAg
ICAgICAgICAgIHRhZykKICAgICAgICAgICAgICBpdGVtIG5hbWUgcG8pCiAgICAgICAgICAgICht
YWtlLWVsZW1lbnQgdGFnIGF0dHJpYnV0ZXMgKHJldmVyc2UhIGFjYykgc3RhcnQtcG9zKSkpCiAg
ICAgICAgICAoZWxzZQogICAgICAgIChsZXQgKChwbyAoaW5wdXQtcG9ydC1sYXN0LXRva2VuLXBv
c2l0aW9uIHBvcnQpKSkKICAgICAgICAgIChsb29wIChlY29ucyBpdGVtIGFjYyAobGlzdCAnYXQg
bmFtZSBwbykpIChpZ25vcmUpKSkpKSkpKQoKICAobGV0ICgoc3BlYyAoYXNzcSB0YWcgc3BlY2lh
bHMpKSkKICAgICAgKGNvbmQKICAgICgobm90IHNwZWMpCiAgICAgIChjb2xsZWN0IGlnbm9yZSAn
KCkpKQogICAgKChudWxsPyAoY2RyIHNwZWMpKQogICAgICAobWFrZS1lbGVtZW50IHRhZyBhdHRy
aWJ1dGVzICcoKSBzdGFydC1wb3MpKQogICAgKChwcm9jZWR1cmU/IChjZHIgc3BlYykpCiAgICAg
IChtYWtlLWVsZW1lbnQgdGFnIGF0dHJpYnV0ZXMgKChjZHIgc3BlYykgcG9ydCkgc3RhcnQtcG9z
KSkKICAgICgocGFpcj8gKGNkciBzcGVjKSkKICAgICAgKGxldCAoKGlnbm9yZSAobGFtYmRhICgp
CiAgICAgICAgICAgICAgKHJlYWQvcnAgeG1sLWdyYW1tYXIgcG9ydAogICAgICAgICAgICAgICAg
ICAgIG1ha2UtZWxlbWVudAogICAgICAgICAgICAgICAgICAgIG1ha2UtY29udGVudAogICAgICAg
ICAgICAgICAgICAgIG1ha2UtY29tbWVudAogICAgICAgICAgICAgICAgICAgIG1ha2UtZGVjbGFy
YXRpb24KICAgICAgICAgICAgICAgICAgICBtYWtlLWNkYXRhCiAgICAgICAgICAgICAgICAgICAg
bWFrZS14bWwtZGVjbGFyYXRpb24KICAgICAgICAgICAgICAgICAgICBtYWtlLWluc3RydWN0aW9u
CiAgICAgICAgICAgICAgICAgICAgc3BlY2lhbHMgc3RyaWN0ICBkZWNvZGVyIGVuY29kaW5nIChp
bnB1dC1wb3J0LXBvc2l0aW9uIHBvcnQpKSkpKQogICAgICAgICAoY29sbGVjdCBpZ25vcmUgKGNk
ciBzcGVjKSkpKQogICAgKGVsc2UKICAgICAgKGVycm9yICJ4bWwtcGFyc2UiICJJbGxlZ2FsIHNw
ZWNpYWwgaGFuZGxlciIgc3BlYykpKSkpCgo7Ki0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t
LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSovCjsqICAgIGF0dHJpYnV0
ZS12YWx1ZS1ncmFtbWFyIC4uLiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
Ki8KO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0tKi8KOyogICAgZ2V0LWRlY29kZXIgLi4u
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwo7Ki0t
LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t
LS0tLS0tLS0tLSovCihkZWZpbmUgKGdldC1kZWNvZGVyOjpwcm9jZWR1cmUgZW5jOjpic3RyaW5n
IGRzdC1lbmMpCiAgKGxldCAoKHNyYy1lbmMgKHN0cmluZy0+c3ltYm9sIChzdHJpbmctdXBjYXNl
IGVuYykpKSkKICAgICAgKGNvbmQKICAgICgob3IgKG5vdCBzcmMtZW5jKSAoZXE/IHNyYy1lbmMg
ZHN0LWVuYykpCiAgICAgIChsYW1iZGEgKHgpIHgpKQogICAgKChlcT8gc3JjLWVuYyAnVVRGLTgp
CiAgICAgIChjb25kCiAgICAgICAgKChtZW1xIGRzdC1lbmMgJyhJU08tODg1OS0xIElTTy04ODU5
LTIgSVNPLTg4NTktMTUpKQogICAgICAgICAgdXRmOC0+aXNvLWxhdGluKQogICAgICAgICgoZXE/
IGRzdC1lbmMgJ1VDUy0yKQogICAgICAgICAgdXRmOC1zdHJpbmctPnVjczItc3RyaW5nKQogICAg
ICAgIChlbHNlCiAgICAgICAgICAobGFtYmRhICh4KSB4KSkpKQogICAgKChtZW1xIHNyYy1lbmMg
JyhJU08tODg1OS0xIElTTy04ODU5LTIgSVNPLTg4NTktMTUpKQogICAgICAoY29uZAogICAgICAg
ICgoZXE/IGRzdC1lbmMgJ1VURi04KQogICAgICAgICAgaXNvLWxhdGluLT51dGY4KQogICAgICAg
ICgoZXE/IGRzdC1lbmMgJ1VDUy0yKQogICAgICAgICAgKGxhbWJkYSAoeCkKICAgICAgICAodXRm
OC1zdHJpbmctPnVjczItc3RyaW5nIChpc28tbGF0aW4tPnV0ZjggeCkpKSkKICAgICAgICAoZWxz
ZQogICAgICAgICAgKGxhbWJkYSAoeCkgeCkpKSkKICAgIChlbHNlCiAgICAgIChsYW1iZGEgKHgp
IHgpKSkpKQoKOyotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t
LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qLwo7KiAgICB4bWwtZ3JhbW1hciAuLi4gICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCjsqLS0tLS0tLS0tLS0t
LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t
Ki8KKGRlZmluZSB4bWwtZ3JhbW1hcgogIChyZWd1bGFyLWdyYW1tYXIgKChpZCAoOiAoaW4gKCJh
ekFaIikgIiE/IikgKCogKGluICgiYXpBWjA5IikgIjpfLSIpKSkpCiAgICAgICAgICAgICAgICAg
ICAgbWFrZS1lbGVtZW50CiAgICAgICAgICAgICAgICAgICAgbWFrZS1jb250ZW50CiAgICAgICAg
ICAgICAgICAgICAgbWFrZS1jb21tZW50CiAgICAgICAgICAgICAgICAgICAgbWFrZS1kZWNsYXJh
dGlvbgogICAgICAgICAgICAgICAgICAgIG1ha2UtY2RhdGEKICAgICAgICAgICAgICAgICAgICBt
YWtlLXhtbC1kZWNsYXJhdGlvbgogICAgICAgICAgICAgICAgICAgIG1ha2UtaW5zdHJ1Y3Rpb24K
ICAgICAgICAgICAgICAgICAgICBzcGVjaWFscwogICAgICAgICAgICAgICAgICAgIHN0cmljdAog
ICAgICAgICAgICAgICAgICAgIGRlY29kZXIKICAgICAgICAgICAgICAgICAgICBlbmNvZGluZwog
ICAgICAgICAgICAgICAgICAgIHBvcykKICAgICAKICAgICAoZGVmaW5lICh1cGRhdGUtc3RhcnQt
cG9zaXRpb24hKQogICAgICAoc2V0ISBwb3MgKGlucHV0LXBvcnQtcG9zaXRpb24gKHRoZS1wb3J0
KSkpKQogICAgIAogICAgICh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Ij8+Iikp
ICI/PiIpCiAgICAgIChsZXQgKChzICh0aGUtc3Vic3RyaW5nIDYgKHRoZS1sZW5ndGgpKSkpCiAg
ICAgICAgIChzdHJpbmctc2V0ISBzICgtZnggKHN0cmluZy1sZW5ndGggcykgMikgI1xzcGFjZSkK
ICAgICAgICAgKGxldCAoKHAgKG9wZW4taW5wdXQtc3RyaW5nIHMpKSkKICAgICAgICAgICAgKGxl
dCBsb29wICgoYXR0ciAnKCkpKQogICAgICAgICAgICAgICAobGV0ICgob2JqIChyZWFkL3JwIGF0
dHJpYnV0ZS1ncmFtbWFyIHAgJ3htbCAjdCBkZWNvZGVyKSkpCiAgICAgICAgICAgICAgICAgIChj
b25kCiAgICAgICAgICAgICAgICAgICAgICgocGFpcj8gb2JqKQogICAgICAgICAgICAgICAgICAg
ICAgKGxvb3AgKGNvbnMgb2JqIGF0dHIpKSkKICAgICAgICAgICAgICAgICAgICAgKChlcT8gb2Jq
ICc+KQogICAgICAgICAgICAgICAgICAgICAgKGxldCAoKHAgcG9zKSkKICAgICAgICAgICAgICAg
ICAgICAgICAgICh1cGRhdGUtc3RhcnQtcG9zaXRpb24hKQogICAgICAgICAgICAgICAgICAgICAg
ICAgKG1ha2UteG1sLWRlY2xhcmF0aW9uIGF0dHIgcCkpKSkpKSkpKQogICAgICgoOiAiPD8iICgq
IChvdXQgIj4iKSkgIj4iKQogICAgICAobGV0ICgocCBwb3MpKQogICAgICAgICAodXBkYXRlLXN0
YXJ0LXBvc2l0aW9uISkKICAgICAgICAgKG1ha2UtaW5zdHJ1Y3Rpb24gKHRoZS1zdHJpbmcpIHAp
KSkKICAgICAoKDogIjwiIGlkICI+IikKICAgICAgKGxldCogKCh0ICh0aGUtc3Vic3RyaW5nIDEg
KC1meCAodGhlLWxlbmd0aCkgMSkpKQogICAgICAgICAgICAgKHRzIChzdHJpbmctPnN5bWJvbCB0
KSkKICAgICAgICAgICAgIChwICh0aGUtcG9ydCkpKQogICAgICAgICAobGV0ICgoZWxlbWVudCAo
Y29sbGVjdC11cC10byBwb3MgaWdub3JlLXcvLXBvcy11cGRhdGUhIHRzICcoKSBwCiAgICAgICAg
ICAgICAgICAgICAgICAgICAgIG1ha2UtZWxlbWVudCBtYWtlLWNvbnRlbnQgbWFrZS1jb21tZW50
IG1ha2UtZGVjbGFyYXRpb24KICAgICAgICAgICAgICAgICAgICAgICAgICAgbWFrZS1jZGF0YSBt
YWtlLXhtbC1kZWNsYXJhdGlvbiBtYWtlLWluc3RydWN0aW9uIHNwZWNpYWxzIHN0cmljdCBkZWNv
ZGVyIGVuY29kaW5nKSkpCiAgICAgICAgICAgICh1cGRhdGUtc3RhcnQtcG9zaXRpb24hKQogICAg
ICAgICAgICBlbGVtZW50KSkpCiAgICAgKCg6ICI8IiBpZCAiLz4iKQogICAgICAobGV0ICgodCAo
dGhlLXN1YnN0cmluZyAxICgtZnggKHRoZS1sZW5ndGgpIDIpKSkpCiAgICAgICAgIChsZXQgKChw
IHBvcykpCiAgICAgICAgICAgICh1cGRhdGUtc3RhcnQtcG9zaXRpb24hKQogICAgICAgICAgICAo
bWFrZS1lbGVtZW50IChzdHJpbmctPnN5bWJvbCB0KSAnKCkgJygpIHApKSkpCiAgICAgKCg6ICI8
IiBpZCAoaW4gIiBcblx0XHIiKSkKICAgICAgKGxldCogKCh0ICh0aGUtc3Vic3RyaW5nIDEgKC1m
eCAodGhlLWxlbmd0aCkgMSkpKQogICAgICAgICAgICAgKHRzIChzdHJpbmctPnN5bWJvbCB0KSkK
ICAgICAgICAgICAgIChwICh0aGUtcG9ydCkpKQogICAgICAgICAobGV0IGxvb3AgKChhdHRyICco
KSkpCiAgICAgICAgICAgIChsZXQgKChvYmogKHJlYWQvcnAgYXR0cmlidXRlLWdyYW1tYXIgcCB0
IHN0cmljdCBkZWNvZGVyKSkpCiAgICAgICAgICAgICAgIChjb25kCiAgICAgICAgICAgICAgICAg
ICgocGFpcj8gb2JqKQogICAgICAgICAgICAgICAgICAgKGxvb3AgKGNvbnMgb2JqIGF0dHIpKSkK
ICAgICAgICAgICAgICAgICAgKChlcT8gb2JqICc+KQogICAgICAgICAgICAgICAgICAgKGxldCAo
KGVsZW1lbnQgKGNvbGxlY3QtdXAtdG8gcG9zIGlnbm9yZS13Ly1wb3MtdXBkYXRlISB0cyAocmV2
ZXJzZSEgYXR0cikgcAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbWFrZS1l
bGVtZW50IG1ha2UtY29udGVudCBtYWtlLWNvbW1lbnQgbWFrZS1kZWNsYXJhdGlvbiBtYWtlLWNk
YXRhCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtYWtlLXhtbC1kZWNsYXJh
dGlvbiBtYWtlLWluc3RydWN0aW9uIHNwZWNpYWxzIHN0cmljdCBkZWNvZGVyIGVuY29kaW5nKSkp
CiAgICAgICAgICAgICAgICAgICAgICAodXBkYXRlLXN0YXJ0LXBvc2l0aW9uISkKICAgICAgICAg
ICAgICAgICAgICAgIGVsZW1lbnQpKQogICAgICAgICAgICAgICAgICAoKGVxPyBvYmogJy8+KQog
ICAgICAgICAgICAgICAgICAgKGxldCAoKHAgcG9zKSkKICAgICAgICAgICAgICAgICAgICAgICh1
cGRhdGUtc3RhcnQtcG9zaXRpb24hKQogICAgICAgICAgICAgICAgICAgICAgKG1ha2UtZWxlbWVu
dCB0cyAocmV2ZXJzZSEgYXR0cikgJygpIHApKSkpKSkpKQogICAgICgoOiAiPC8iIGlkICI+IikK
ICAgICAgKHVwZGF0ZS1zdGFydC1wb3NpdGlvbiEpCiAgICAgIChzdHJpbmctPnN5bWJvbCAodGhl
LXN1YnN0cmluZyAyICgtZnggKHRoZS1sZW5ndGgpIDEpKSkpCiAgICAgKCgrIChvdXQgIjwiKSkK
ICAgICAgKHVwZGF0ZS1zdGFydC1wb3NpdGlvbiEpCiAgICAgIChtYWtlLWNvbnRlbnQgKGRlY29k
ZXIgKHRoZS1zdHJpbmcpKSAoLSBwb3MgKHRoZS1sZW5ndGg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AgICAqLwo7Ki0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t
LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSovCihkZWZpbmUgKHhtbC1zdHJpbmctZGVj
b2RlLWlubmVyISBzdHIgb2wgbmwgcmVzKQogIChkZWZpbmUgKGNoYXItdmFsdWUgYykKICAgICAg
KGNvbmQKICAgICgoY2hhci1udW1lcmljPyBjKQogICAgICAoLWZ4IChjaGFyLT5pbnRlZ2VyIGMp
IChjaGFyLT5pbnRlZ2VyICNcMCkpKQogICAgKChjaGFyPD0/IGMgI1xGKQogICAgICAoK2Z4IDEw
ICgtZnggKGNoYXItPmludGVnZXIgYykgKGNoYXItPmludGVnZXIgI1xBKSkpKQogICAgKGVsc2UK
ICAgICAgKCtmeCAxMCAoLWZ4IChjaGFyLT5pbnRlZ2VyIGMpIChjaGFyLT5pbnRlZ2VyICNcYSkp
KSkpKQogIChsZXQgKChvbC0yICgtZnggb2wgMikpKQogICAgICAobGV0IGxvb3AgKChpIDApCiAg
ICAgICAgKGogMCkpCiAgICAoaWYgKD1meCBqIG5sKQogICAgICAgIHJlcwogICAgICAgIChsZXQg
KChjIChzdHJpbmctcmVmIHN0ciBpKSkpCiAgICAgICAgKGlmIChhbmQgKGNoYXI9PyBjICNcJSkg
KDxmeCBpIG9sLTIpKQogICAgICAgICAgICAobGV0ICgoYzEgKHN0cmluZy1yZWYgc3RyICgrZngg
aSAxKSkpCiAgICAgICAgICAgICAgKGMyIChzdHJpbmctcmVmIHN0ciAoK2Z4IGkgMikpKSkKICAg
ICAgICAgICAgICAoaWYgKGFuZCAoY2hhci1oZXhudW1lcmljPyBjMSkgKGNoYXItaGV4bnVtZXJp
Yz8gYzIpKQogICAgICAgICAgICAgIChsZXQqICgodjEgKGNoYXItdmFsdWUgYzEpKQogICAgICAg
ICAgICAgICAgICAodjIgKGNoYXItdmFsdWUgYzIpKQogICAgICAgICAgICAgICAgICAoZCAoaW50
ZWdlci0+Y2hhciAoK2Z4ICgqZnggdjEgMTYpIHYyKSkpKQogICAgICAgICAgICAgICAgICAoc3Ry
aW5nLXNldCEgcmVzIGogZCkKICAgICAgICAgICAgICAgICAgKGxvb3AgKCtmeCBpIDMpICgrZngg
aiAxKSkpCiAgICAgICAgICAgICAgKGJlZ2luCiAgICAgICAgICAgICAgICAgIChzdHJpbmctc2V0
ISByZXMgaiBjKQogICAgICAgICAgICAgICAgICAobG9vcCAoK2Z4IGkgMSkgKCtmeCBqIDEpKSkp
KQogICAgICAgICAgICAoYmVnaW4KICAgICAgICAgICAgICAoc3RyaW5nLXNldCEgcmVzIGogYykK
ICAgICAgICAgICAgICAobG9vcCAoK2Z4IGkgMSkgKCtmeCBqIDEpKSkpKSkpKSkKCjsqLS0tLS0t
LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t
LS0tLS0tKi8KOyogICAgeG1sLWNvdW50IC4uLiAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAqLwo7Ki0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t
LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSovCihkZWZpbmUgKHhtbC1j
b3VudCBzdHIgb2wpCiAgKGxldCBsb29wICgoaSAwKQogICAgICAgICAgKGMgMCkpCiAgICAgIChj
b25kCiAgICAoKD1meCBpIG9sKQogICAgICBjKQogICAgKChjaGFyPT8gKHN0cmluZy1yZWYgc3Ry
IGkpICNcJikKICAgICAgKGNvbmQKICAgICAgICAoKHN1YnN0cmluZy1hdD8gc3RyICImbHQ7IiBp
KQogICAgICAgICAgKGxvb3AgKCtmeCBpIDQpICgrZnggYyAxKSkpCiAgICAgICAgKChzdWJzdHJp
bmctYXQ/IHN0ciAiJmd0OyIgaSkKICAgICAgICAgIChsb29wICgrZngga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tLS0tKi8KKGRlZmluZSAoeG1sLWRlY29kZSEgc3RyIHJlcyBvbCBu
bCkKICAobGV0IGxvb3AgKChpIDApCiAgICAgICAgICAoaiAwKSkKICAgICAgKGNvbmQKICAgICgo
PWZ4IGkgb2wpCiAgICAgIHJlcykKICAgICgoY2hhcj0/IChzdHJpbmctcmVmIHN0ciBpKSAjXCYp
CiAgICAgIChjb25kCiAgICAgICAgKChzdWJzdHJpbmctYXQ/IHN0ciAiJmx0OyIgaSkKICAgICAg
ICAgIChzdHJpbmctc2V0ISByZXMgaiAjXDwpCiAgICAgICAgICAobG9vcCAoK2Z4IGkgNCkgKCtm
eCBqIDEpKSkKICAgICAgICAoKHN1YnN0cmluZy1hdD8gc3RyICImZ3Q7IiBpKQogICAgICAgICAg
KHN0cmluZy1zZXQhIHJlcyBqICNcPikKICAgICAgICAgIChsb29wICgrZnggaSA0KSAoK2Z4IGog
MSkpKQogICAgICAgICgoc3Vic3RyaW5nLWF0PyBzdHIgIiZhbXA7IiBpKQogICAgICAgICAgKHN0
cmluZy1zZXQhIHJlcyBqICNcJikKICAgICAgICAgIChsb29wICgrZnggaSA1KSAoK2Z4IGogMSkp
KQogICAgICAgICgoc3Vic3RyaW5nLWF0PyBzdHIgIiZxdW90OyIgaSkKICAgICAgICAgIChzdHJp
bmctc2V0ISByZXMgaiAjXCIpCiAgICAgICAgICAobG9vcCAoK2Z4IGkgNikgKCtmeCBqIDEpKSkK
ICAgICAgICAoKHN1YnN0cmluZy1hdD8gc3RyICImbmJzcDsiIGkpCiAgICAgICAgICAoc3RyaW5n
LXNldCEgcmVzIGogI1xzcGFjZSkKICAgICAgICAgIChsb29wICgrZnggaSA2KSAoK2Z4IGogMSkp
KQogICAgICAgICgoc3Vic3RyaW5nLWF0PyBzdHIgIiYjIiBpKQogICAgICAgICAgKGxldCBsaWlw
ICgoaSAoK2Z4IGkgMikpCiAgICAgICAgICAgIChuIDApKQogICAgICAgIChpZiAoPWZ4IGkgb2wp
CiAgICAgICAgICAgIHJlcwogICAgICAgICAgICAobGV0ICgoYyAoc3RyaW5nLXJlZiBzdHIgaSkp
KQogICAgICAgICAgICAoaWYgKGNoYXItbnVtZXJpYz8gYykKICAgICAgICAgICAgICAgIChsaWlw
ICgrZnggaSAxKQogICAgICAgICAgICAgICAgICAoK2Z4ICgqZnggbiAxMCkKICAgICAgICAgICAg
ICAgICAgKC1meCAoY2hhci0+aW50ZWdlciBjKQogICAgICAgICAgICAgICAgICAgIChjaGFyLT5p
bnRlZ2VyICNcMCkpKSkKICAgICAgICAgICAgICAgIChiZWdpbgogICAgICAgICAgICAgICAgICAo
c3RyaW5nLXNldCEgcmVzIGogKGludGVnZXItPmNoYXIgbikpCiAgICAgICAgICAgICAgICAgIChs
b29wICgrZnggaSAxKSAoK2Z4IGogMSkpKSkpKSkpCiAgICAgICAgKGVsc2UKICAgICAgICAgIChz
dHJpbmctc2V0ISByZXMgaiAoc3RyaW5nLXJlZiBzdHIgaSkpCiAgICAgICAgICAobG9vcCAoK2Z4
IGkgMSkgKCtmeCBqIDEpKSkpKQogICAgKGVsc2UKICAgICAgKHN0cmluZy1zZXQhIHJlcyBqIChz
dHJpbmctcmVmIHN0ciBpKSkKICAgICAgKGxvb3AgKCtmeCBpIDEpICgrZnggaiAxKSkpKSkpCgo7
Ki0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t
LS0tLS0tLS0tLS0tLSovCjsqICAgIHhtbC1zdHJpbmctZGVjb2RlIC4uLiAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KOyotLS0tLS0tLS0tLS0tLS0tLS0tLS0t
LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qLwooZGVmaW5l
ICh4bWwtc3RyaW5nLWRlY29kZSBzdHIpCiAgKGxldCAoKG9sIChzdHJpbmctbGVuZ3RoIHN0cikp
KQogICAgICAoaWYgKD49Znggb2wgMykKICAgICAgKGxldCAoKG5sICh4bWwtY291bnQgc3RyIG9s
KSkpCiAgICAgICAgKGlmICg9Znggbmwgb2wpCiAgICAgICAgKHN0cmluZy1jb3B5IHN0cikKICAg
ICAgICAobGV0ICgocmVzIChtYWtlLXN0cmluZyBubCkpKQogICAgICAgICAgICAoeG1sLWRlY29k
ZSEgc3RyIHJlcyBvbCBubCkKICAgICAgICAgICAgcmVzKSkpCiAgICAgIChzdHJpbmctY29weSBz
dHIpKSkpCgo7Ki0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t
LS0tLS0tLS0tLS0tLS0tLS0tLS0tLSovCjsqICAgIHhtbC1zdHJpbmctZGVjb2RlISAuLi4gICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwo7Ki0tLS0tLS0tLS0tLS0t
LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSov
CihkZWZpbmUgKHhtbC1zdHJpbmctZGVjb2RlISBzdHIpCiAgKGxldCAoKG9sIChzdHJpbmctbGVu
Z3RoIHN0cikpKQogICAgICAoaWYgKD49Znggb2wgMykKICAgICAgKGxldCAoKG5sICh4bWwtY291
bnQgc3RyIG9sKSkpCiAgICAgICAgKGlmICg9Znggbmwgb2wpCiAgICAgICAgc3RyCiAgICAgICAg
KGJlZ2luCiAgICAgICAgICAgICh4bWwtZGVjb2RlISBzdHIgc3RyIG9sIG5sKQogICAgICAgICAg
ICAoc3RyaW5nLXNocmluayEgc3RyIG5sKSkpKQogICAgICBzdHIpKSkKCjsqLS0tLS0tLS0tLS0t
LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t
Ki8KOyogICAgeG1sLXN0cmluZy1lbmNvZGUgLi4uICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAqLwo7Ki0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t
LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSovCihkZWZpbmUgKHhtbC1zdHJpbmct
ZW5jb2RlIHN0cikKICAoZGVmaW5lIChjb3VudCBzdHIgb2wpCiAgICAgIChsZXQgbG9vcCAoKGkg
MCkKICAgICAgICAobiAwKSkKICAgIChpZiAoPWZ4IGkgb2wpCiAgICAgICAgbgogICAgICAgIChs
ZXQgKChjIChzdHJpbmctcmVmIHN0ciBpKSkpCiAgICAgICAgKGNhc2UgYwogICAgICAgICAgKCgj
XCIpCiAgICAgICAgICAgIChsb29wICgrZnggaSAxKSAoK2Z4IG4gNikpKQogICAgICAgICAgKCgj
XCYpCiAgICAgICAgICAgIChsb29wICgrZnggaSAxKSAoK2Z4IG4gNSkpKQogICAgICAgICAgKCgj
XDwgI1w+KQogICAgICAgICAgICAobG9vcCAoK2Z4IGkgMSkgKCtmeCBuIDQpKSkKICAgICAgICAg
IChlbHNlCiAgICAgICAgICAgIChsb29wICgrZnggaSAxKSAoK2Z4IG4gMSkpKSkpKSkpCiAgKGRl
ZmluZSAoZW5jb2RlIHN0ciBvbCBubCkKICAgICAgKGlmICg9Znggbmwgb2wpCiAgICAgIHN0cgog
ICAgICAobGV0ICgocmVzIChtYWtlLXN0cmluZyBubCkpKQogICAgICAgIChsZXQgbG9vcCAoKGkg
MCkKICAgICAgICAgICAgKGogMCkpCiAgICAgICAgKGlmICg9ZnggaiBubCkKICAgICAgICAgICAg
cmVzCiAgICAgICAgICAgIChsZXQgKChjIChzdHJpbmctcmVmIHN0ciBpKSkpCiAgICAgICAgICAg
ICAgKGNhc2UgYwogICAgICAgICAgICAgICgoI1w8KQogICAgICAgICAgICAgIChibGl0LXN0cmlu
ZyEgIiZsdDsiIDAgcmVzIGogNCkKICAgICAgICAgICAgICAobG9vcCAoK2Z4IGkgMSkgKCtmeCBq
IDQpKSkKICAgICAgICAgICAgICAoKCNcPikKICAgICAgICAgICAgICAoYmxpdC1zdHJpbmchICIm
Z3Q7IiAwIHJlcyBqIDQpCiAgICAgICAgICAgICAgKGxvb3AgKCtmeCBpIDEpICgrZnggaiA0KSkp
CiAgICAgICAgICAgICAgKCgjXCYpCiAgICAgICAgICAgICAgKGJsaXQtc3RyaW5nISAiJmFtcDsi
IDAgcmVzIGogNSkKICAgICAgICAgICAgICAobG9vcCAoK2Z4IGkgMSkgKCtmeCBqIDUpKSkKICAg
ICAgICAgICAgICAoKCNcIikKICAgICAgICAgICAgICAoYmxpdC1zdHJpbmchICImcXVvdDsiIDAg
cmVzIGogNikKICAgICAgICAgICAgICAobG9vcCAoK2Z4IGkgMSkgKCtmeCBqIDYpKSkKICAgICAg
ICAgICAgICAoZWxzZQogICAgICAgICAgICAgIChzdHJpbmctc2V0ISByZXMgaiBjKQogICAgICAg
ICAgICAgIChsb29wICgrZnggaSAxKSAoK2Z4IGogMSkpKSkpKSkpKSkKICAobGV0ICgob2wgKHN0
cmluZy1sZW5ndGggc3RyKSkpCiAgICAgIChlbmNvZGUgc3RyIG9sIChjb3VudCBzdHIgb2wpKSkp
Cgo7Ki0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t
LS0tLS0tLS0tLS0tLS0tLSovCjsqICAgIHJlYWQteG1sIC4uLiAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwo7Ki0tLS0tLS0tLS0tLS0tLS0tLS0t
LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSovCihkZWZp
bmUgKHJlYWQteG1sICMhb3B0aW9uYWwgKHBvcnQ6OmlucHV0LXBvcnQgKGN1cnJlbnQtaW5wdXQt
cG9ydCkpKQogICh4b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dHRyKQogICAgICAg
ICAgICAgIChsZXQgKChhdHRyIChjYXIgbGF0dHIpKSkKICAgICAgICAgICAgKGNhc2UgKGNhciBh
dHRyKQogICAgICAgICAgICAgICAgKCh4bWw6bGFuZykKICAgICAgICAgICAgICAgIChzZXQhIHht
bC1sYW5nIChjZHIgYXR0cikpKQogICAgICAgICAgICAgICAgKCh4bWxucykKICAgICAgICAgICAg
ICAgIChzZXQhIHhtbC1yb290IChjb25zIChjZHIgYXR0cikgeG1sLXJvb3QpKSkKICAgICAgICAg
ICAgICAgICgodmVyc2lvbikKICAgICAgICAgICAgICAgIChzZXQhIHJvb3QtdmVyIChzdHJpbmct
Pm51bWJlciAoY2RyIGF0dHIpKSkpCiAgICAgICAgICAgICAgICAoZWxzZQogICAgICAgICAgICAg
ICAgKGxldCAoKHN0ciAoc3ltYm9sLT5zdHJpbmcgKGNhciBhdHRyKSkpKQogICAgICAgICAgICAg
ICAgKHdoZW4gKHN1YnN0cmluZz0/IHN0ciAieG1sbnM6IiA2KQogICAgICAgICAgICAgICAgICAo
bGV0KiAoKGwgKHN0cmluZy1sZW5ndGggc3RyKSkKICAgICAgICAgICAgICAgICAgICAgIChzIChz
dWJzdHJpbmcgc3RyIDYgbCkpCiAgICAgICAgICAgICAgICAgICAgICAoc2kgKHN0cmluZy0+c3lt
Ym9sIHMpKSkKICAgICAgICAgICAgICAgICAgICAgIChzZXQhIHhtbC1ucwogICAgICAgICAgICAg
ICAgICAgICAgICAoY29ucyAoY29ucyAoY2RyIGF0dHIpIHNpKQogICAgICAgICAgICAgICAgICAg
ICAgICAgIHhtbC1ucykpKSkpKSkKICAgICAgICAgICAgKGxvb3AzIChjZHIgbGF0dHIpKSkpKSkp
CiAgICAgICAgKGxvb3AxIChjZHIgbCkpKSkKICAgICAgKHVubGVzcyB4bWwtcm9vdAogICAgKGVy
cm9yICJ4bWwtbWV0YWRhdGEiICJFbXB0eSBYTUwgZG9jdW1lbnQgISIgeG1sKSkKICAgICAgOzsg
VmFsdWVzIGFyZSA6CiAgICAgIDs7IC0gWE1MIFZlcnNpb24gKDEuMCBvciAxLjEpIG9yICNmCiAg
ICAgIDs7IC0gWE1MIEVuY29kaW5nICgjZiBpZiB1bmtub3duKQogICAgICA7OyAtIHhtbDpsYW5n
IHZhbHVlCiAgICAgIDs7IC0gUGFpciwgd2hpY2ggY2FyIGlzIHRoZSBmaXJzdCBkYXRhIG1hcmt1
cCwgYW5kCiAgICAgIDs7ICBjZHIgdGhlIGRlZmF1bHQgbmFtZXNwYWNlCiAgICAgIDs7IC0geG1s
IGZpcnN0IGRhdGEgbWFya3VwIHZlcnNpb24gYXR0cmlidXRlICgwIGlmIHVuc3BlY2lmaWVkKQog
ICAgICA7OyAtIGxpc3Qgb2YgcHJlZml4ZWQgbmFtZXNwYWNlcyAocHJlZml4IC4gcGF0aCkKICAg
ICAgKHZhbHVlcyB4bWwtdmVyIHhtbC1lbmMgeG1sLWxhbmcgeG1sLXJvb3Qgcm9vdC12ZXIgeG1s
LW5zKSkp

------=_Part_2269274_799726553.1644899034192--