2

I have an xml file that would I would like to parse (E.g. using lxml.etree) apply a set of css styles to, and then export. For instance, the input would be this xml:

<root>
  <foo id="good">
    <bar class="bad">
    </bar>
  </foo>
</root>

and this css:

bar {
   color:red
}

#good {
   color: green
}

and the resulting XML would look something like:

<root>
  <foo id="good" color="green">
    <bar class="bad" color="red">
    </bar>
  </foo>
</root>

so that the effects of the css are represented in the attributes of the resulting tree.

I can do this in python, but I thought there might be a simple way to reuse existing libraries to make it much easier.

Thanks!

MemoryWrangler
  • 335
  • 2
  • 10

0 Answers0