sabre-io / xml

sabre/xml is an XML library that you may not hate.
http://sabre.io/xml/
BSD 3-Clause "New" or "Revised" License
515 stars 77 forks source link

Fixed handling of elements from foreign namespaces in values object (2.2) #270

Closed mrbig closed 4 months ago

mrbig commented 7 months ago

When encountering an element from another namespace the value object parser does skip the opening element. However when it encounters the closing element it did handle it like it was the closing element of the one being processed.

This commit and unit test fixes the issue by ignoring the element completely. Without the patch the unit test would not parse the lastName element.

This patch is against the branch 2.2, because I'm still using this one, I hope it's not a problem. I've checked the master branch as well, and it should be straightforward to apply it there as well.

BTW: would it be possible to add mappings for multiple namespaces?

codecov[bot] commented 7 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 97.06%. Comparing base (fa20da3) to head (a476c68). Report is 1 commits behind head on 2.2.

:exclamation: Current head a476c68 differs from pull request most recent head adb731d. Consider uploading reports for the commit adb731d to get more accurate results

Additional details and impacted files ```diff @@ Coverage Diff @@ ## 2.2 #270 +/- ## ============================================ + Coverage 97.05% 97.06% +0.01% Complexity 116 116 ============================================ Files 13 13 Lines 509 511 +2 ============================================ + Hits 494 496 +2 Misses 15 15 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

phil-davis commented 4 months ago

Forward-port to master is PR #273