Skip to content

Fixing issue with Namespaced Attributes - #146

Merged
leonelsanchesdasilva merged 4 commits into
mainfrom
issue-135
Jan 23, 2026
Merged

Fixing issue with Namespaced Attributes#146
leonelsanchesdasilva merged 4 commits into
mainfrom
issue-135

Conversation

@leonelsanchesdasilva

Copy link
Copy Markdown
Collaborator

Resolves #135.

@github-actions

github-actions Bot commented Jan 23, 2026

Copy link
Copy Markdown

Coverage report

St.
Category Percentage Covered / Total
🟡 Statements
76.75% (+0.18% 🔼)
2334/3041
🟡 Branches
65.82% (+0.25% 🔼)
1250/1899
🟡 Functions 74.13% 318/429
🟡 Lines
77.22% (+0.18% 🔼)
2203/2853
Show files with reduced coverage 🔻
St.
File Statements Branches Functions Lines
🟢 xpath/xpath.ts
81.22% (-0.28% 🔻)
64.52% (-0.56% 🔻)
80% (-0.49% 🔻)
81.87% (-0.29% 🔻)

Test suite run success

523 tests passing in 42 suites.

Report generated by 🧪jest coverage report action from 99a655b

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds regression coverage and adjusts XSLT/XPath/DOM handling to correctly process and serialize namespaced attributes (and related whitespace/order behaviors), resolving issue #135.

Changes:

  • Added a comprehensive test suite covering multiple ways of selecting namespaced attributes (prefix, local-name(), namespace-uri()), plus a call-template ordering regression.
  • Updated XSLT processing/serialization to better handle whitespace text nodes and preserve xsl:text whitespace.
  • Aligned XPath node namespace property naming (namespaceUri) and updated the bundled XPath subproject.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
tests/namespaced-attributes.test.tsx Adds regression tests for namespaced attribute selection and template output ordering.
src/xslt/xslt.ts Adjusts whitespace handling, template winner selection, and avoids processing attribute child nodes as template content.
src/xpath/xpath.ts Removes namespaceURI shim and documents namespaceUri as the standard property.
src/xpath/selector.ts Renames namespace property mapping to namespaceUri in conversions.
src/xpath/lib Updates XPath subproject revision.
src/dom/xnode.ts Introduces fromXslText flag on nodes to control whitespace trimming during serialization.
src/dom/xml-parser.ts Decodes text node content during parse (he.decode).
src/dom/xml-functions.ts Preserves whitespace-only text nodes when they originate from xsl:text.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread tests/namespaced-attributes.test.tsx Outdated
Comment thread tests/namespaced-attributes.test.tsx
Comment thread src/xslt/xslt.ts
Comment thread src/xslt/xslt.ts
Comment thread src/xpath/selector.ts
leonelsanchesdasilva and others added 3 commits January 23, 2026 10:11
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@leonelsanchesdasilva
leonelsanchesdasilva merged commit fcd5b88 into main Jan 23, 2026
3 checks passed
@leonelsanchesdasilva
leonelsanchesdasilva deleted the issue-135 branch January 23, 2026 18:25
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.

XSLT Cannot Extract Namespaced Attributes in v3.4.0

2 participants