Make .nsmap available in XSLT extensions.#269
Merged
scoder merged 1 commit intolxml:masterfrom Apr 5, 2019
Merged
Conversation
scoder
requested changes
Aug 9, 2018
| return funicode(self._c_node.ns.prefix) | ||
| return None | ||
|
|
||
| property nsmap: |
Member
There was a problem hiding this comment.
Looks like a copy of _Element.nsmap, so the dict building should go into a shared helper function.
| extensions = { ('extns', 'show-nsmap') : MyExt() } | ||
|
|
||
| result = tree.xslt(style, extensions=extensions) | ||
| self.assertEqual(etree.tostring(result, pretty_print=True), """\ |
Member
There was a problem hiding this comment.
This needs to compare to a bytes literal to work in Py3.
Member
|
Documentation and docstring missing. Changelog entry would also be nice. |
Author
|
I'm afraid I won't be able to address the comments in the review in foreseeable future. Would you prefer this pull request closed, or left open, for the off chance that someone else in the community has the need and time to polish this? |
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.
When adding namespaced elements/attributes in
executeof XSLT extension element, newxmlnsdeclaration is generated with prefixns0. At the same time it does not seem to be possible to figure out what are the existing namespaces and prefixes in theinput_node, resulting inThis patch makes it possible to see the namespace map.