Well I got Blackhole to work though I'll still be posting a few suggestions and questions later. I used it to import and use sxml>>xml successfully.
It gives me output like
><P >P5There seems to be nothing to say. <S />After a while he stammers, "Oh, I'm sorry," to fill the silence.</P ><P >P3</P
instead of the more conventional
<P> P5There seems to be nothing to say. <S/>After a while he stammers, "Oh, I'm sorry," to fill the silence.</P> <P> P3</P>
Is there a technical reason to have the '>' after the newline and the indentation layout instead of before them? Or is this just the way it happened to get coded?
(Don't worry about the P5There and such -- my application put them there by mistake and I'll be dealing with them myself)
-- hendrik
Afficher les réponses par date
Hi Hendrick,
I've used scml->xml with Blackhole and got normal xml output. How are you using it?
Best,
Álvaro Castro
On Tue, Jan 24, 2012 at 11:56 PM, Hendrik Boom hendrik@topoi.pooq.comwrote:
Well I got Blackhole to work though I'll still be posting a few suggestions and questions later. I used it to import and use sxml>>xml successfully.
It gives me output like
><P >P5There seems to be nothing to say. <S />After a while he stammers,
"Oh, I'm sorry," to fill the silence.</P
<P
>P3</P
instead of the more conventional
<P> P5There seems to be nothing to say. <S/>After a while he stammers,
"Oh, I'm sorry," to fill the silence.</P> <P> P3</P>
Is there a technical reason to have the '>' after the newline and the indentation layout instead of before them? Or is this just the way it happened to get coded?
(Don't worry about the P5There and such -- my application put them there by mistake and I'll be dealing with them myself)
-- hendrik
Gambit-list mailing list Gambit-list@iro.umontreal.ca https://webmail.iro.umontreal.ca/mailman/listinfo/gambit-list
On Wed, 25 Jan 2012 00:37:35 +0100, Álvaro Castro-Castilla wrote:
Hi Hendrick,
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.
-- hendrik
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@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@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@notlookedfor:~/dv/gambit$
-- hendrik
On Sat, 28 Jan 2012 22:38:46 +0000, Hendrik Boom wrote:
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@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@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@notlookedfor:~/dv/gambit$
I swapped a few lines in smxl-to-xml.scm. But I find myself wondering if this might cause problems elsewhere. Why, after all, were they out of order in the first place?
*** /home/hendrik/dv/gambit/blackhole-libs/string/sxml-to-xml.scm 2012-01-20 12:04:49.000000000 -0500 --- sxml-to-xml.scm 2012-01-29 10:15:19.000000000 -0500 *************** *** 377,390 **** (@char>> #\space port) (lp (- i 1))))))))) (out>>/body>> (lambda (body>>) - (maybe-indent>> next-level) (@char>> #> port) (body>>) (@char>> #< port) (@char>> #/ port) (@symbol>> (@car l) port) ! (maybe-indent>> maybe-level) ! (@char>> #> port))) (end>> (lambda () (if xml? (begin (@char>> #\space port) --- 377,390 ---- (@char>> #\space port) (lp (- i 1))))))))) (out>>/body>> (lambda (body>>) (@char>> #> port) + (maybe-indent>> next-level) (body>>) (@char>> #< port) (@char>> #/ port) (@symbol>> (@car l) port) ! (@char>> #> port) ! (maybe-indent>> maybe-level))) (end>> (lambda () (if xml? (begin (@char>> #\space port)
Now the output looks considerably better:
<?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*>
-- hendrik
Hello Hendrik,
one month later, but hopefully still useful.
On Tue, 24 Jan 2012 22:56:32 +0000 (UTC) Hendrik Boom hendrik@topoi.pooq.com wrote:
Well I got Blackhole to work though I'll still be posting a few suggestions and questions later. I used it to import and use sxml>>xml successfully.
It gives me output like
><P >P5There seems to be nothing to say. <S />After a while he >stammers,
"Oh, I'm sorry," to fill the silence.</P ><P >P3</P
instead of the more conventional
<P> P5There seems to be nothing to say. <S/>After a while he stammers,
"Oh, I'm sorry," to fill the silence.</P> <P> P3</P>
Is there a technical reason to have the '>' after the newline and the indentation layout instead of before them? Or is this just the way it happened to get coded?
Actually, these two XML fragments are different. The first one is:
* element "P" * text "P5There seems to ... ... silence." * end element "p" * element "p" * text "P3" * end element "p"
And the second is:
* element "P" * text " P5There seems to ... .... silence." * end element "p" * element "p" * text " P3" * end element "p"
Note that the text elements contain extra whitespace. In this concrete case, it is not a problem, but in general case the conventional indenting can change the meaning of the document. However, we still need an XML in a human-friendly layout instead of a one-line dump. Newline before ">" is a neat trick, which always correct.
(Don't worry about the P5There and such -- my application put them there by mistake and I'll be dealing with them myself)
-- hendrik