AsherGlick / Burrito

An overlay tool for Guild Wars 2 that works on linux
GNU General Public License v2.0
79 stars 18 forks source link

Update XML parsing to ignore XML prefixes from tags #245

Closed jmetzmeier closed 9 months ago

jmetzmeier commented 9 months ago

While using the provided tool to parse "TehsTrails" marker pack I discovered the converter script fails when the XML document provides a default namespace. This update simply strips the namespace prefix the elementree adds to tags in this case.

AsherGlick commented 9 months ago

This looks fine, can you provide a minimal example for me to test?

jmetzmeier commented 9 months ago

@AsherGlick I tested using the .taco file from here: https://github.com/xrandox/TehsTrails/releases/tag/v5.1.1. This pack ships all the markers in a single XML file. I did also test with the tekkit markers to ensure I didn't break anything there. I extracted a small portion from that XML that should function as a test:

<OverlayData 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xsi:schemaLocation="https://github.com/xrandox/Gw2_Marker_Pack_DTD_XSD https://raw.githubusercontent.com/xrandox/Gw2_Marker_Pack_DTD_XSD/main/GW2MarkerPack.
xsd"
xmlns="https://github.com/xrandox/Gw2_Marker_Pack_DTD_XSD">
  <MarkerCategory name="tt" DisplayName="Teh's Trails - Map Completion" />
  <POIs>
    <POI MapID="218" xpos="-311.41" ypos="13.6012" zpos="-248.649" type="tt.mc.cm.wm.wpheart" GUID="/qEmg5uNK0W7hwW1V7VTlw==" copy="[&amp;BKsDAAA=]"/>
  </POIs>
</OverlayData>