Andrew Coppin <andrewcop...@btinternet.com> writes:

> I've got a folder with about 80 XML files in it. I want to
> take each file and make specific modifications to it.
> (Mostly just finding specific attributes and changing their
> values to make then all consistent.)
>
> Now I guess it wouldn't take me /that/ long to code
> something from scratch. But does anybody have a better
> suggestion for tools or libraries that might be useful?

HaXml

Before google earth exposed a facility for computing path
lengths, I wrote my own using HaXml. The guts of it look like
this:

main …
         xml <- fmap (xmlParse filename) (readFile filename)
         print_path_length xml

print_path_length (Document _ _ content _)
    = print $ compute_length $ coordinate_string_to_list coordinate_string
      where coordinate_string
                = singleCString
                  . (txt `o` children `o` deep (tag "coordinates"))
                  $ (CElem content)

which gives some idea of the flavour.

-- 
Jón Fairbairn                                 jon.fairba...@cl.cam.ac.uk
http://www.chaos.org.uk/~jf/Stuff-I-dont-want.html  (updated 2010-09-14)


_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to