cdl_convert icon indicating copy to clipboard operation
cdl_convert copied to clipboard

_remove_xmlns only removes one xmlns

Open mfe opened this issue 9 years ago • 0 comments

If a ccc contains several cc with a xmlns attribute each, only the first cc is going to be retrieved. Sample code :

import cdl_convert.parse

path = '/path/to/xmlns_demo.ccc'
assert(len(cdl_convert.parse.parse_ccc(path).color_corrections) == 2)

xmlns_demo.ccc : https://gist.github.com/mfe/10873b57451afb4a40127860d8604554

Indeed, the code is only replacing 1 instance of xmlns : https://github.com/shidarin/cdl_convert/blob/master/cdl_convert/parse.py#L745

I did this very simple fix to confirm my assumptions: xml_string = re.sub(' xmlns="[^"]+"', '', xml_string)

It resolves the pb and I can retrieved both ccs.

How about that ?

Anyways, thanks for this great and very useful lib.

mfe avatar Oct 25 '16 22:10 mfe