Skip to content

AbstractStaxContentHandler sets NamespaceContext on every start/end element [SPR-7621] #12277

@spring-projects-issues

Description

@spring-projects-issues

Eric Dalquist opened SPR-7621 and commented

AbstractStaxContentHandler tracks the currently in-scope namespaces and sets them on every StartElement and EndElement event. According to the StAX APIs it is only necessary to send the NamespaceContext when it is changing (a new namespaces comes into or goes out of scope). The current functionality results with namespace attributes attached to every element in the document.

The fix is to track when a namespace prefix has been added or removed and only send the NamespaceContext at that time.


Affects: 3.0.4

Attachments:

Referenced from: commits ab21dba, 35da7bd

Metadata

Metadata

Assignees

Labels

in: coreIssues in core modules (aop, beans, core, context, expression)type: bugA general bug

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions