This repository has been archived by the owner on Jun 3, 2024. It is now read-only.
Reporter Bean Parser rejects attributes that declare namespaces (e.g. xmlns:context="...") #103
+129
−17
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.