http://qs1969.pair.com?node_id=437395


in reply to XML::Simple help

Looking at the man page for XML::Simple, it looks like the "ValueAttr" option does not really fit with the data that you have. It looks like this option is intended for cases where lots of different elements have a common attribute, and you want to have this parsed into a structure where the element names are hash keys and the values of the common attribute are hash values.

In your case, you have a lot of instances with the same element name and two common attributes, where one attribute serves as a "key" field (unique to each instance of the element) and the other does not; in this case, the "KeyAttr" option works well, and there simply isn't anything else that the module can do for you. The initial reply above is the way to go to get what you want.