emacs-devel
[Top][All Lists]
Advanced

[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/



reply via email to

[Prev in Thread] Current Thread [Next in Thread]