[gambit-list] sxml>>xml layout question.

Hendrik Boom hendrik at topoi.pooq.com
Sat Jan 28 17:38:46 EST 2012


On Wed, 25 Jan 2012 02:38:32 +0000, Hendrik Boom wrote:

> On Wed, 25 Jan 2012 00:37:35 +0100, Álvaro Castro-Castilla wrote:
> 
>> Hi Hendrik,
>> 
>> I've used scml->xml with Blackhole and got normal xml output. How are
>> you using it?
> 
> Thanks.  That's valuable information.  Now that I know that this
> behaviour isn't normal, I'll find it worthwhile trimming the text and
> either tracking down the problem or posting a smaller version here.

OK.  Here's the file try.scm:



(define test
  '(*TOP* (*PI* xml "version=\"1.0\" encoding=\"UTF-8\"")
       (urn:oasis:names:tc:opendocument:xmlns:office:1.0:document
        (@ (urn:oasis:names:tc:opendocument:xmlns:office:1.0:version 
"1.1")
           (urn:oasis:names:tc:opendocument:xmlns:office:1.0:mimetype
            "application/vnd.oasis.opendocument.text"))
        (urn:oasis:names:tc:opendocument:xmlns:office:1.0:body
         (urn:oasis:names:tc:opendocument:xmlns:office:1.0:text
          (@ (urn:oasis:names:tc:opendocument:xmlns:text:1.0:use-soft-
page-breaks
              "true"))
          (P "P4" "Catharine")
          (P "P5"
             "Catharine is sitting in a seaside cafeteria at a counter 
facing the ocean. "
             (S)
             "She looks out over the sea at the massing clouds and 
shudders. "
             (S)
             "Andrei, a thin man, comes to sit beside her at the counter. 
"
             (S)
             "Lightning flashes among the clouds."))))))



(import std/string/sxml-to-xml)

(define o (open-output-file "testout.xml"))
(sxml>>xml test o)
(close-output-port o)


I run bh and import try.scm:

hendrik at notlookedfor:~/write/storm/storm/icv$ bh
Gambit Scheme w/ Black Hole
> (import try)
> 


and afterwards, the output file testout.xml is as follows:


<?xml version="1.0" encoding="utf-8"?>
<*TOP*
 ><*PI*
  >xmlversion="1.0" encoding="UTF-8"</*PI*
 ><urn:oasis:names:tc:opendocument:xmlns:office:1.0:document urn:oasis:names:tc:opendocument:xmlns:office:1.0:version="1.1" urn:oasis:names:tc:opendocument:xmlns:office:1.0:mimetype="application/vnd.oasis.opendocument.text"
  ><urn:oasis:names:tc:opendocument:xmlns:office:1.0:body
   ><urn:oasis:names:tc:opendocument:xmlns:office:1.0:text urn:oasis:names:tc:opendocument:xmlns:text:1.0:use-soft-page-breaks="true"
    ><P
     >P4Catharine</P
    ><P
     >P5Catharine is sitting in a seaside cafeteria at a counter facing the ocean. <S />She looks out over the sea at the massing clouds and shudders. <S />Andrei, a thin man, comes to sit beside her at the counter. <S />Lightning flashes among the clouds.</P
    ></urn:oasis:names:tc:opendocument:xmlns:office:1.0:text
   ></urn:oasis:names:tc:opendocument:xmlns:office:1.0:body
  ></urn:oasis:names:tc:opendocument:xmlns:office:1.0:document
 ></*TOP*
>


Do I perhaps have the wrong version of sxml>>xml ?

I got my version using

hendrik at notlookedfor:~/dv/gambit$ git clone git://github.com/pereckerdal/blackhole-libs.git
Cloning into 'blackhole-libs'...
remote: Counting objects: 208, done.
remote: Compressing objects: 100% (102/102), done.
remote: Total 208 (delta 107), reused 201 (delta 104)
Receiving objects: 100% (208/208), 199.39 KiB, done.
Resolving deltas: 100% (107/107), done.
hendrik at notlookedfor:~/dv/gambit$ 

-- hendrik




More information about the Gambit-list mailing list