Skip to content

Preserve namespace metadata on XPath attribute results - #137

Open
rupayon123 wants to merge 1 commit into
antchfx:masterfrom
rupayon123:contribution/xpath-attribute-namespace-20260923
Open

rupayon123 wants to merge 1 commit into
antchfx:masterfrom
rupayon123:contribution/xpath-attribute-namespace-20260923

Conversation

@rupayon123

Copy link
Copy Markdown

Fixes #108.

XPath queries for namespaced attributes currently return a synthetic AttributeNode with its value and local name, but empty Prefix and NamespaceURI. Copy those fields from the NodeNavigator when creating the result. A regression test covers //@xlink:href and an ordinary unprefixed attribute.

The new test failed on the current master branch and passes with this change. go test ./... -count=1, go test -race ./... -count=1, go vet ./..., and git diff --check pass locally. Remote CI remains to be checked. Prepared with AI assistance and reviewed and tested before submission.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Missing AttributeNode prefix and namespace URI

1 participant