Hi Alex,

> I would like to put it into a file "lib/xml2.l" for the next
> release, crediting you as the author (name and email). Do I have
> your permission?

Sure, that would be an honour!

> about what goes into the basic release, to protect it from blowing
> up too much (and thus being no longer "pico").

Would not it be better to have only one function to parse xml in
picolisp distribution?  I will have to refine it and test it more
thouroughly though.

> One problem, though, I still see with comments. As they are parsed
> on the tag level, they won't work if they are nested somewhere else,
> e.g.
>
>    <hi a="1" <!-- comment --> b="2">
>       123
>    </hi>

It is not a valid xml:

XML Parsing Error: not well-formed
Location: file:///tmp/a.xml
Line Number 1, Column 11:
<hi a="1" <!-- comment --> b="2">123</hi>
----------^

A comment can be inside an element:

<hi a="1" b="2">12<!-- comment -->34</hi>

xml2 returns (hi ((a . "1") (b . "2")) "12" "34")

Filtering comments by a preprocessor would not work in general
unfortunatelly because something like:

<hi a="1" b="2">1<![CDATA[2<!-- comment -->3]]>4</hi>

is a valid xml and the comment is not a comment but an ordinary
text:-(

Thanks,

Tomas
-- 
UNSUBSCRIBE: mailto:[EMAIL PROTECTED]

Reply via email to