Support parsing without namespace awareness in BeanDefinitionParserDelegate and DefaultBeanDefinitionDocumentReader [SPR-6017] #10686
Labels
in: core
Issues in core modules (aop, beans, core, context, expression)
type: enhancement
A general enhancement
Milestone
Tuomas Kiviaho opened SPR-6017 and commented
BeanDefinitionParserDelegate and DefaultBeanDefinitionDocumentReader currently use node.getNamespaceURI & getLocalName() without considering that namespace awareness might be turned off (or DOM 1 is in use) leading these methods to return null values. The code is robust enough to avoid NPE:s but all elements belong to default namespace when namespace awareness is off since isDefaultNamespace(String) method will always receive null.
By providing middle-man methods getNamespaceURI(Node) and getLocalName(Node) in delegate as public methods (or alternatively as protected with additional public isDefaultNamespace(Node)) would solve the problem when namespace awareness is turned off (or DOM 1 is used). These methods could be overridden to provide means other means to solve namespace and localname while Spring could by default still stick with DOM 2 implementations.
Affects: 2.5.6
Referenced from: commits 320f08a, 7835e66, 7d37c92, 019c3c2
The text was updated successfully, but these errors were encountered: