From: Øyvin Halfdan Thuv
Subject: XML output
Date: 
Message-ID: <slrnfb5la5.18dq.oyvinht@bacchus.pvv.ntnu.no>
There's a bunch of XML libraries available for CL. What is actually being used
for real software? Which one is stable/mature?  Any experiences welcome.

I need the library to write XML documents (invoices), and (perhaps) read them
back into memory too. I'm using LispWorks 5.0.2 Pro for Windows.

-- 
Oyvin

From: GP lisper
Subject: Re: XML output
Date: 
Message-ID: <slrnfb6b59.42v.spambait@phoenix.clouddancer.com>
On Fri, 3 Aug 2007 07:12:05 +0000 (UTC), <·······@bacchus.pvv.ntnu.no> wrote:
> There's a bunch of XML libraries available for CL. What is actually being used
> for real software? Which one is stable/mature?  Any experiences welcome.

For reading the Internet crap that passes as XML, I'm using s-xml
multiple times a day.  The CVS has a patch to handle CDATA.


-- 
Lisp:  Powering `Impossible Thoughts since 1958

-- 
Posted via a free Usenet account from http://www.teranews.com
From: David Lichteblau
Subject: Re: XML output
Date: 
Message-ID: <slrnfb6g64.8pv.usenet-2006@babayaga.math.fu-berlin.de>
On 2007-08-03, GP lisper <········@CloudDancer.com> wrote:
> For reading the Internet crap that passes as XML, I'm using s-xml
> multiple times a day.  The CVS has a patch to handle CDATA.

The OP wanted to generate well-formed XML, not parse broken XML...

Besides, how much broken XML is there really?

The web is full of remarkably broken HTML (everything from mildly broken
to unbelievably bad junk), but broken XML is much less common.  There is
the occasional serializer that, say, `forgets' to escape ampersands, but
overall most XML tools are not that bad.

And for broken HTML I would really recommend an HTML parser designed to
handle it, not an XML parser.  Closure's HTML parser does a very good
job at dealing with random web pages.
From: GP lisper
Subject: Re: XML output
Date: 
Message-ID: <slrnfb7t4b.ank.spambait@phoenix.clouddancer.com>
On 3 Aug 2007 14:50:36 GMT, <···········@lichteblau.com> wrote:
> On 2007-08-03, GP lisper <········@CloudDancer.com> wrote:
>> For reading the Internet crap that passes as XML, I'm using s-xml
>> multiple times a day.  The CVS has a patch to handle CDATA.
>
> The OP wanted to generate well-formed XML, not parse broken XML...

Why did you hack off his actual statement?

On Fri, 3 Aug 2007 07:12:05 +0000 (UTC), <·······@bacchus.pvv.ntnu.no> wrote:
> There's a bunch of XML libraries available for CL. What is actually being used
> for real software? Which one is stable/mature?  Any experiences welcome.

read the first question and last statement again.


Bad XML on the Internet?  About half of the places I regularly
datamine.  Which is why I use s-xml, since just as in the recent
browser history discusssion, I want the data, not list of xml parse
errors.  All bad XML needs is to have a web programmer that wants to
roll-his-own generator.

Awful HTML?  Seems to be everywhere, I'm so happy I don't parse it
anymore.

Generating XML?  I'd probably use your software.


-- 
Lisp:  Powering `Impossible Thoughts since 1958

-- 
Posted via a free Usenet account from http://www.teranews.com
From: Harald Hanche-Olsen
Subject: Re: XML output
Date: 
Message-ID: <pcohcnf20ih.fsf@shuttle.math.ntnu.no>
+ GP lisper <········@CloudDancer.com>:

| Awful HTML?  Seems to be everywhere, I'm so happy I don't parse it
| anymore.

And if one does need to parse it, there may be strategies worse than
running it through tidy first.

-- 
* Harald Hanche-Olsen     <URL:http://www.math.ntnu.no/~hanche/>
- It is undesirable to believe a proposition
  when there is no ground whatsoever for supposing it is true.
  -- Bertrand Russell
From: Tim X
Subject: Re: XML output
Date: 
Message-ID: <87wsw7itzh.fsf@lion.rapttech.com.au>
David Lichteblau <···········@lichteblau.com> writes:

> On 2007-08-03, GP lisper <········@CloudDancer.com> wrote:
>> For reading the Internet crap that passes as XML, I'm using s-xml
>> multiple times a day.  The CVS has a patch to handle CDATA.
>
> The OP wanted to generate well-formed XML, not parse broken XML...
>
> Besides, how much broken XML is there really?
>
> The web is full of remarkably broken HTML (everything from mildly broken
> to unbelievably bad junk), but broken XML is much less common.  There is
> the occasional serializer that, say, `forgets' to escape ampersands, but
> overall most XML tools are not that bad.
>
> And for broken HTML I would really recommend an HTML parser designed to
> handle it, not an XML parser.  Closure's HTML parser does a very good
> job at dealing with random web pages.

My experience is very different. I've found large amounts of the XML out there
is not correctly formed. 

I wrote a very basic podcast aggregator in CL. Initially, I tried a couple of
CL XML libraries, but in the end, used cl-pcre because too much of the XML in
the podcast RSS feeds was broken. Using regexp worked well as it made it easy
to deal with badly formed XML. The most common issue I encountered was
mismatched tags - start and ending tag not the same, sometimes just a case
difference, but all too often, they were different in the letters. From memory,
I think RSS feeds out of wordpress were often a problem (things have probably
improved, this was over 12 months ago). 

Tim

-- 
tcross (at) rapttech dot com dot au
From: David Lichteblau
Subject: Re: XML output
Date: 
Message-ID: <slrnfb600b.48r.usenet-2006@babayaga.math.fu-berlin.de>
On 2007-08-03, �yvin Halfdan Thuv <·······@bacchus.pvv.ntnu.no> wrote:
> There's a bunch of XML libraries available for CL. What is actually being used
> for real software? Which one is stable/mature?  Any experiences welcome.
>
> I need the library to write XML documents (invoices), and (perhaps) read them
> back into memory too. I'm using LispWorks 5.0.2 Pro for Windows.

You can find a brief comparison in the ALU wiki:
http://wiki.alu.org/XML_Parser_Libraries

My understanding is that, of the parsers listed there, only Closure XML
and CL-XML actually purport to confirm to the XML spec.

Closure XML is asdf-installable and has been ported to LispWorks.


As for serialization, see the FAQs "Writing XML", "Serializing DOM", and
"Parsing into XMLS-like lists" in

  http://common-lisp.net/project/cxml/quickstart.html

On the lowest level though, serialization in cxml is done by sending SAX
events to so-called "serialization sinks", and any kind of surface
syntax for serialization is possible as a convenience layer over SAX.
From: Øyvin Halfdan Thuv
Subject: Re: XML output
Date: 
Message-ID: <slrnfbmfs7.vq.oyvinht@bacchus.pvv.ntnu.no>
In article <··························@babayaga.math.fu-berlin.de>,
 David Lichteblau wrote:

>Closure XML is asdf-installable and has been ported to LispWorks.
>
>
>As for serialization, see the FAQs "Writing XML", "Serializing DOM", and
>"Parsing into XMLS-like lists" in
>
>  http://common-lisp.net/project/cxml/quickstart.html

I played around a bit with CXML, and have now implemented much of what I
needed for emitting XML-output. It was very straight forward, stable and
flexible. Thanks a lot!

>On the lowest level though, serialization in cxml is done by sending SAX
>events to so-called "serialization sinks", and any kind of surface
>syntax for serialization is possible as a convenience layer over SAX.

Just saw your blog posting about STP, btw.. While working with CXML the last
two days, I was thinking that a CLOS-wrapper would be very useful... and
there it was .. :)

--
Oyvin
From: Volkan YAZICI
Subject: Re: XML output
Date: 
Message-ID: <1186263044.278957.170810@k79g2000hse.googlegroups.com>
On Aug 3, 10:12 am, ·······@bacchus.pvv.ntnu.no (�yvin Halfdan Thuv)
wrote:
> There's a bunch of XML libraries available for CL. What is actually being used
> for real software? Which one is stable/mature?  Any experiences welcome.
>
> I need the library to write XML documents (invoices), and (perhaps) read them
> back into memory too. I'm using LispWorks 5.0.2 Pro for Windows.

Closure-SXML[1] is quite capable of parsing/producing XML. Moreover,
cxml has an active on-going development and community accessible via
mailing-lists and IRC[2]. You can easily produce XML output at any
detail using a string sink with SAX interface supplied by cxml.

 [1] http://www.cliki.net/cxml
 [2] #lisp @ irc.freenode.net

But if you just need to produce simple XML documents, you might want
to check CL-WHO[3]. It cannot give you the verbosity presented by
cxml, but you'll move faster with barebone tag and attributes using s-
expressions.

 [3] http://cliki.net/cl-who


Regards.