Repository navigation
Conversation
Fix three documentation issues in XPathContext and Node: - registerVarLookupFunc example: correct callback argument order from ($varname,$ns,$data) to ($data,$varname,$ns) matching the actual XS implementation (GH #208) - Same example: fix function name registerVarLookup() to registerVarLookupFunc() (GH #208) - Same example: fix broken Perl quoting in XPath expression district='Brooklyn' to district="Brooklyn" (GH #238) - registerNs: document that namespace registrations are per-context and not shared between XPathContext objects, with a GPX example showing re-registration for sub-tree contexts (GH #239)
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
Fix three long-standing documentation errors in XPathContext and Node POD.
Why
The
registerVarLookupFuncexample had the callback arguments in the wrong order ($varname, $ns, $datainstead of$data, $varname, $ns), a typo in the function name, and broken Perl quoting. These have confused users since at least 2013 (RT #84267). Separately, the namespace/XPath documentation didn't mention thatregisterNscalls are per-context — a common gotcha when iterating child nodes with new XPathContext objects.How
All changes in
docs/libxml.dbkwith regenerated.podfiles:LibXML.xs:1284-1286)registerVarLookup()toregisterVarLookupFunc()district='Brooklyn'todistrict="Brooklyn"(inner single quotes broke Perl syntax)registerNsdocs and a GPX example to the "NOTE ON NAMESPACES AND XPATH" section in Node.podTesting
make testpasses (all test files)Closes #208, closes #238, closes #239