chenyunguiMilook / SwiftyXML

The most swifty way to deal with XML data in swift 5.
MIT License
103 stars 28 forks source link

XML class public properties mask child XML elements with the same name #16

Closed andyj-at-aspin closed 4 years ago

andyj-at-aspin commented 4 years ago

The public properties of the XML class (name, attributes, value and children) can mask child XML elements with the same element name when attempting to use DynamicMemberLookup to traverse the XML chain.

A real-world occurrence of this issue is that full traversal of the xml tree of the GPX file format (https://en.wikipedia.org/wiki/GPS_Exchange_Format) using DynamicMemberLookup is impossible because of child elements named as "name" in the wptType, rteType, trkType and personType elements.

I have created a pull request for a suggested fix that renames the public properties of the XML class by adding xml... as a prefix to the property name.

andyj-at-aspin commented 4 years ago

My branch is now merged into v3.10