Summary: | Error with new XML Format if tag-name contains characters that are not valid as XML Tags | ||
---|---|---|---|
Product: | [Applications] kphotoalbum | Reporter: | Dominik Stadler <dominik.stadler> |
Component: | XML backend | Assignee: | KPhotoAlbum Bugs <kpabugs> |
Status: | RESOLVED FIXED | ||
Severity: | major | ||
Priority: | NOR | ||
Version: | 4.0 (KDE4) | ||
Target Milestone: | --- | ||
Platform: | Unlisted Binaries | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: |
Description
Dominik Stadler
2009-11-16 15:13:58 UTC
the change in format is as follows: previously a tag in the index.xml looked as follows: <image width="1600" startDate="2001-01-01T13:30:07" height="1200" md5sum="aeee29c985d036f97ef53ef2811995a9" file="Paul, Lara und Samuel/dscn0885.jpg" endDate="2001-01-01T13:30:07" label="dscn0885" angle="90" > <options> <option name="Jahreszeit_Stimmung" > <value value="Fasching" /> </option> <option name="Orte" > <value value="Oberkappel" /> </option> <option name="Personen" > <value value="Paul" /> </option> </options> </image> now it looks like this: <image width="1200" Jahreszeit/Stimmung="7" Orte="6" startDate="2001-01-01T13:30:07" height="1600" md5sum="aeee29c985d036f97ef53ef2811995a9" Personen="18" file=XXX.jpg" endDate="2001-01-01T13:30:07" label="dscn0885" angle="90" /> so the item "Jahreszeit/Stimmung" was an XML-VALUE before and is an XML-TAG now. However XML puts much tighter restrictions on what an XML-TAG can contain, that's where the problem occurs. as a workaround, replacing this with e.g. underscore to "Jahreszeit_Stimmung" allowed me to continue I got the following suggestion on the mailing list: "Seems like you checked the "Choose speed over readability for index.xml on the Dtabase backend tab in the settings dialog." Unchecking this option fixed my problem after I manually changed the XML and reverted it again later. However I still think KPA should handle that case gracefully or at least warn the user in the options dialog that this is the case, i.e. special characters in the categories will prevent KPA from loading this database in the future!! Git commit 1e000f14a92540f67d9a7598488d9acbf9f6b4b2 by Miika Turkia. Committed on 23/01/2012 at 21:47. Pushed by mturkia into branch 'master'. Encode special characters in XML attribute names Special characters that are not allowed by XML spec in attribute name are encoded in hex using following notation _.XX M +8 -0 Settings/DatabaseBackendPage.cpp M +4 -0 Settings/DatabaseBackendPage.h M +15 -1 XMLDB/FileReader.cpp M +15 -1 XMLDB/FileWriter.cpp http://commits.kde.org/kphotoalbum/1e000f14a92540f67d9a7598488d9acbf9f6b4b2 |