[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Problems with xml-parse-string
From: |
Andy Wingo |
Subject: |
Re: Problems with xml-parse-string |
Date: |
Sat, 25 Sep 2010 16:42:29 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux) |
Hello,
On Fri 24 Sep 2010 18:46, Lars Magne Ingebrigtsen <address@hidden> writes:
> To take a concrete example: You want the src of the img node you have.
>
> xml.el: (cdr (assq 'img (cadr node)))
> sxml.el: (if (and (consp (cadr node))
> (eq (caadr node) '@))
> (cadr (assq 'img node)))
You should use something like sxml-match.
http://www.gnu.org/software/guile/docs/master/guile.html/sxml_002dmatch.html#sxml_002dmatch
(sxml-match node
((img (@ (src ,src)))
src))
A bit verbose for this particular example, but it's the best, most
robust way to parse out values from xml-in-s-expressions.
Andy
--
http://wingolog.org/
- Re: Problems with xml-parse-string, (continued)
- Re: Problems with xml-parse-string, Eli Zaretskii, 2010/09/25
- Re: Problems with xml-parse-string, David Kastrup, 2010/09/25
- Re: Problems with xml-parse-string, Wojciech Meyer, 2010/09/25
- Re: Problems with xml-parse-string, Eli Zaretskii, 2010/09/25
- Re: Problems with xml-parse-string, Wojciech Meyer, 2010/09/25
- Re: Problems with xml-parse-string, Juanma Barranquero, 2010/09/25
- Re: Problems with xml-parse-string, Chong Yidong, 2010/09/25
- Re: Problems with xml-parse-string, Stefan Monnier, 2010/09/24
- Re: Problems with xml-parse-string, Chong Yidong, 2010/09/24
- Re: Problems with xml-parse-string, Wojciech Meyer, 2010/09/24
- Re: Problems with xml-parse-string,
Andy Wingo <=
- Re: Problems with xml-parse-string, Leo, 2010/09/25
- Re: Problems with xml-parse-string, Leo, 2010/09/25
- Re: Problems with xml-parse-string, Wojciech Meyer, 2010/09/25
- Re: Problems with xml-parse-string, Stefan Monnier, 2010/09/25
- Re: Problems with xml-parse-string, Leo, 2010/09/25
- Re: Problems with xml-parse-string, Leo, 2010/09/25
- Re: Problems with xml-parse-string, Stefan Monnier, 2010/09/26
- Re: Problems with xml-parse-string, Leo, 2010/09/26
- pcase.el (was: Problems with xml-parse-string), Ted Zlatanov, 2010/09/25
- Re: pcase.el, Stefan Monnier, 2010/09/26