Use human-readable XPath in XMLLocation #121
Labels
isState:New
A new issue that needs to be classified to a type.
isType:Feature
An issue that adds new features to the project.
Milestone
Is your feature request related to a problem? Please describe.
When checking the file
tests/data/examples/Ex_Entry_Exit.xodr
, one of the Issue locations may look likeExplanation of the XPath value:
With the
<FileLocation/>
, it is possible to look into the source code, and find more details. With them it is possible to find this element in third-party tools, which are noch integrated in the product. But this is slow and annoying.Describe the solution you'd like
The following XPath would be much better understandable from human perspective and it is still resolvable by the result pooling to calculate the
<FileLocation/>
entry.Describe alternatives you've considered
The path is calculated by the standard Python function
etree.ElementTree.getpath()
, which can not be adapted. So, we need a helper function which creates the human-readable version of the XPath by accessing the original element and replacing the index values in the XPath with attributes values. Base could be a mapping table defining the relevant attribute, which should be used.road --> id
laneSection --> s
lane --> id
roadMark --> sOffset
elevation --> s
superelevation --> s
geometry --> s
Only needed for elements, which may occur multiple times in a row. In case we forget an entry in the table, we can still use the index here. But we have then the most important element locations in a human-readable format.
Additional context
The text was updated successfully, but these errors were encountered: