ixml: implement if_ixml_node~get_namespace_uri - #1235
Merged
larshp merged 1 commit intoSep 15, 2026
Merged
Conversation
The method was an `ASSERT 1 = 'todo'`, so asking a parsed node which namespace it belongs to ended the program. The prefix was readable (get_namespace_prefix returns it), the binding behind it was not - and the prefix alone says nothing, it is the uri that identifies a namespace. The declaration that binds it is an ordinary attribute: "xmlns:<prefix>", or "xmlns" for a node without a prefix. It may stand on the node itself or on any ancestor and the nearest one wins, so the lookup walks up the parents and returns the first it finds. An undeclared prefix has no uri and stays initial rather than raising. lcl_document delegates to its node, as it does for get_attributes and get_parent next to it. Tests: a prefixed root, a child that inherits the declaration from its root, a default namespace, a document without one, and an undeclared prefix. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TKSWLpid4QLV6XWAoPixbb
oblomov-dev
force-pushed
the
claude/nifty-meitner-ema3y8-namespace-uri
branch
from
September 15, 2026 14:48
3166402 to
f23a353
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What is wrong
The method is a stub,
src/ixml/cl_ixml.clas.locals_imp.abap:so asking a parsed node which namespace it belongs to ends the program rather
than answering:
The prefix itself is readable —
get_namespace_prefixreturnsn— but aprefix says nothing on its own: it is local to the document, and the uri is
what identifies the namespace. Anything that has to tell one namespace from
another (a SOAP envelope, an OData document, an abapGit file) needs the uri,
and today cannot ask for it.
The change
The declaration that binds a prefix is an ordinary attribute:
xmlns:<prefix>, orxmlnsfor a node without a prefix. It may stand on thenode itself or on any of its ancestors, and the nearest one wins — so the
lookup walks up the parents and returns the first binding it finds:
An undeclared prefix has no uri: