metrics-spring icon indicating copy to clipboard operation
metrics-spring copied to clipboard

Reporter Bean Parser rejects attributes that declare namespaces (e.g. xmlns:context="...")

Open danapsimer opened this issue 9 years ago • 0 comments

The AbstractReporterElementParser has a method in it's ValidationContext class called "rejectUnmatchedProperties". This modification changes the behavior of this method to ignore attributes that have a namespace specifier (e.g. "xmlns:context"). In XML namespaces can be defined on any element and attributes can be applied to elements from other namespaces. The XML spec defines that these should be ignored when processing elements by processors that do not understand them.

One could argue that rejecting unknown properties (i.e. attributes) is not a good idea since as an eXtensible Markup Language, XML allows adding attributes to elements that will not be known by older processors. However, the advantage of detecting attributes that don't belong may out weight that concern.

danapsimer avatar Jan 21 '15 19:01 danapsimer