Fixing issue with Namespaced Attributes - #146
Merged
Merged
Conversation
Coverage report
Show files with reduced coverage 🔻
Test suite run success523 tests passing in 42 suites. Report generated by 🧪jest coverage report action from 99a655b |
Contributor
There was a problem hiding this comment.
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 acall-templateordering regression. - Updated XSLT processing/serialization to better handle whitespace text nodes and preserve
xsl:textwhitespace. - 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.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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.
Resolves #135.