I've had this discussion with Alex already, I ended up with this after it: (setq Lst (in "atom.xml" (and (xml?) (xml))))
It will parse the whole thing into a list. /Henrik On Fri, Jul 25, 2008 at 6:15 AM, Tomas Hlavaty <[EMAIL PROTECTED]> wrote: > Hi Alex, > > what is the way to load an XML file? I seem to be having problems > with some cases depending on where the ?xml declaration and comments > are: > > : (load '@lib/xml.l) > -> attr > : (let F '/tmp/a.xml (call 'cat F) (in F (xml))) > <hi>123</hi> > -> (hi NIL "123") > : (let F '/tmp/b.xml (call 'cat F) (in F (xml))) > <!-- comment --> > <hi>123</hi> > -> NIL > : (let F '/tmp/c.xml (call 'cat F) (in F (xml))) > <?xml version="1.0" encoding="UTF-8"?> > <hi>123</hi> > [/tmp/c.xml:1] ?>\ > <hi>123</hi>\ > -- XML parse error > ? > : (let F '/tmp/d.xml (call 'cat F) (in F (xml))) > <?xml version="1.0" encoding="UTF-8"?> > <!-- comment --> > <hi>123</hi> > [/tmp/d.xml:1] ?>\ > <!--\ comment\ -->\ > <hi>123</hi>\ > -- XML parse error > ? > : (let F '/tmp/e.xml (call 'cat F) (in F (xml))) > <!-- comment --> > <?xml version="1.0" encoding="UTF-8"?> > <hi>123</hi> > -> NIL > > I am using picolisp-2.3.2. > > Thanks, > > Tomas > -- > UNSUBSCRIBE: mailto:[EMAIL PROTECTED] > ------=_Part_6557_33419765.1216951730383 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline <div dir="ltr">I've had this discussion with Alex already, I ended up with this after it: (setq Lst (in "atom.xml" (and (xml?) (xml))))<br><br>It will parse the whole thing into a list.<br><br>/Henrik<br><br> <div class="gmail_quote">On Fri, Jul 25, 2008 at 6:15 AM, Tomas Hlavaty <<a href="mailto:[EMAIL PROTECTED]">[EMAIL PROTECTED]</a>> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"> Hi Alex,<br> <br> what is the way to load an XML file? I seem to be having problems<br> with some cases depending on where the ?xml declaration and comments<br> are:<br> <br> : (load '@lib/xml.l)<br> -> attr<br> : (let F '/tmp/a.xml (call 'cat F) (in F (xml)))<br> <hi>123</hi><br> -> (hi NIL "123")<br> : (let F '/tmp/b.xml (call 'cat F) (in F (xml)))<br> <!-- comment --><br> <hi>123</hi><br> -> NIL<br> : (let F '/tmp/c.xml (call 'cat F) (in F (xml)))<br> <?xml version="1.0" encoding="UTF-8"?><br> <hi>123</hi><br> [/tmp/c.xml:1] ?>\<br> <hi>123</hi>\<br> -- XML parse error<br> ?<br> : (let F '/tmp/d.xml (call 'cat F) (in F (xml)))<br> <?xml version="1.0" encoding="UTF-8"?><br> <!-- comment --><br> <hi>123</hi><br> [/tmp/d.xml:1] ?>\<br> <!--\ comment\ -->\<br> <hi>123</hi>\<br> -- XML parse error<br> ?<br> : (let F '/tmp/e.xml (call 'cat F) (in F (xml)))<br> <!-- comment --><br> <?xml version="1.0" encoding="UTF-8"?><br> <hi>123</hi><br> -> NIL<br> <br> I am using picolisp-2.3.2.<br> <br> Thanks,<br> <br> Tomas<br> <font color="#888888">--<br> UNSUBSCRIBE: mailto:<a href="mailto:picolisp@software-lab.de">picolisp@software-lab.de</a>?subject=Unsubscribe<br> </font></blockquote></div><br></div> ------=_Part_6557_33419765.1216951730383-- -- UNSUBSCRIBE: mailto:[EMAIL PROTECTED] -------