lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On Oct 20, 2014, at 6:15 AM, Dirk Laurie <dirk.laurie@gmail.com> wrote:

> 2014-10-20 12:04 GMT+02:00 steve donovan <steve.j.donovan@gmail.com>:
>> On Mon, Oct 20, 2014 at 11:18 AM, Dirk Laurie <dirk.laurie@gmail.com> wrote:
>>> xml.basic_parse doesn't [1], but I can always use lom.parse.
>>> It does not parse <! and <? though, is xml.basic_parse supposed to?
>> 
>> basic_parse is a fallback processor based on code by Roberto from the
>> wiki.  To make it fully 'compliant' would be hard, tho not impossible.
>> Diminishing returns?
> 
> I don't actually need those, but diff noticed that two lines were missing
> from the reconstituted XML file.
> 

Unless you have a real need, and a real need for pain, sticking with the XML "0.2" infoset (mixed content, unordered attributes, no other features) is a good idea, and is the minimum for a general XML processor. Lotta people like "0.1" (text only significant in leaves) or "0.0" (no text).

My most common problem with unparsers is that I want to specify which namespace prefixes are introduced and where, or to generate fragments when I know particular prefixes have been externally introduced.

The real mark of quality for me is optimized use of CDATA sections to reduce quoting overhead, but this is mostly politics: blowing up readers which try to draw a non-existent distinction between <![CDATA[><&]]> and &gt;&lt;&amp;.

-- 
Jay