[Chicago] modifying xml ?

Carl Karsten carl at personnelware.com
Thu Oct 14 05:49:12 CEST 2010


On Wed, Oct 13, 2010 at 4:06 PM, Lukasz Szybalski <szybalski at gmail.com> wrote:
> Hello,
> I'm trying to modify some big xml by replacing the data with my data.
>
> Find node and replace "last name" ,"first name"....order detail, where
> order details might have multiple children.
> Are there any useful tutorials or sample code  for doing that with lxml
>
> I would like to pull up the object like:
>
> Root.Customer.someSubNode.Order.Product = 'this is a new name'
>
> I'm not trying to build a new xml, I'm just modifying an existing xml,
> replacing data, and passing that along.
>
> What would be the easiest way to do this?
>
> Thanks,
> Lucas
>

I have yet to become really comfortable with xml - I think because it
is more flexible than I want it to be.   I have done what you
describe, but I have no clue how well I did it.

I wrote this originally as proof of concept, then turned it into a
demo for a talk:
http://github.com/CarlFK/veyepar/blob/master/dj/scripts/xmldemo.py

then I used what I learned here:
http://github.com/CarlFK/veyepar/blob/master/dj/scripts/enc.py

feel free to ask questions, it is how we learn.

-- 
Carl K


More information about the Chicago mailing list