How could one parse a xml-like string and convert it a separated list?
I am trying to convert the following string:
<Categories>
<Category Assigned="0">
6 Level
<Category Assigned="1">
6.2 Level
<Category Assigned="0">
6.3 Level
<Category Assigned="0">
6.4 Level
<Category Assigned="1">
6.5 Level
</Category>
</Category>
</Category>
</Category>
</Category>
</Categories>
To a separated list like:
6 Level/6.2 Level/6.3 Level/6.4 Level/6.5 Level, 6 Level/6.2 Level
Robin Mills of exiv2 provided a perl script: http://dev.exiv2.org/boards/3/topics/1912?r=1923#message-1923
That would need to also parse Assigned="1"
. How can this be done in C++ to use in digikam, inside dmetadata.cpp
with a structure like:
QStringList ntp = tagsPath.replaceInStrings("<Category Assigned="0">", "/");
I don't have enough programming background to figure this out, and haven't found any code sample online that do something similar. I'd also like to include the code in exiv2 itself, so that other applications can benefit.
Working code will be included in digikam: https://bugs.kde.org/show_bug.cgi?id=345220