Warning appears about using a specific form of xml xpaths
Opened this issue · 0 comments
Poikilos commented
This occurs in xml mode (not tested in _LXML_AVAILABLE
case)
After adding some debug output (lines 1, 4, 5 and 8 below), I can see the original string sent, so we can compare it to the suggested string:
[_xpath_query] xml query_string="/ns:svg/ns:g/ns:text[@id='character_name_']/ns:tspan"
/home/owner/git/pyinkscape/pyinkscape/inkscape.py:529: FutureWarning: This search is broken in 1.3 and earlier, and will be fixed in a future version. If you rely on the current behaviour, change it to "./ns:svg/ns:g/ns:text[@id='character_name_']/ns:tspan"
return self.__tree.findall(query_string, namespaces=namespaces)
Got no <text id="character_name_">. Trying group (potential Inkscape-generated g tag)
[_xpath_query] xml query_string="/ns:svg/ns:g[@id='character_name_']/ns:tspan"
/home/owner/git/pyinkscape/pyinkscape/inkscape.py:529: FutureWarning: This search is broken in 1.3 and earlier, and will be fixed in a future version. If you rely on the current behaviour, change it to "./ns:svg/ns:g[@id='character_name_']/ns:tspan"
return self.__tree.findall(query_string, namespaces=namespaces)
Got no <g id="character_name_"> either
so for comparison:
/ns:svg/ns:g/ns:text[@id='character_name_']/ns:tspan
old./ns:svg/ns:g/ns:text[@id='character_name_']/ns:tspan
suggested/ns:svg/ns:g[@id='character_name_']/ns:tspan
old./ns:svg/ns:g[@id='character_name_']/ns:tspan
suggested
However I'm not sure if you "rely on the current behaviour" so I'm not sure they should be changed to the suggested queries.