Re: Parsing XML from javascript within gnome-shell



On Sun, Jun 5, 2011 at 12:30 PM, Dru Moore <dru dru-id co uk> wrote:
> I've been playing around with writing some shell-extensions and have a
> need to parse some proper xml returned from a service endpoint.
> Normally (in an app) I'd use libxml2 and parse the response that way.
>
> Is libxml2 fully supported? I see there is a .gir file for it but that
> doesn't look complete to me - i.e. I can imports.gi.libxml2 but I'm
> having difficulty doing anything with it.
>
> Could someone give me a quick pointer on how to use libxml2 from
> javascript OR suggest a better way of parsing a full xml document -
> would GMarkup be a better choice?

If you use gjs, you can use E4X, see https://developer.mozilla.org/en/E4X
-- 
Johan Dahlin


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