-
-
Notifications
You must be signed in to change notification settings - Fork 179
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement fn:path#0 and fn:path#1 #4402
Conversation
|
||
final StringBuilder value = new StringBuilder(); | ||
final StringBuilder attributeValue = new StringBuilder(); | ||
if (node.getNodeType() == Type.TEXT) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a switch
would be more correct here?
// its comment node siblings. | ||
final int nodePosition = getNodePosition(node); | ||
if (nodePosition > 0) { | ||
value.append(String.format("/comment()[%d]", nodePosition)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is the 1st position nodePosition 0 or 1 ?
does the XQTS not require /comment()
(without indication) to be used iso /comment()[1]
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dizzzz This is passing all XQTS tests for fn-path
// like-named processing-instruction node siblings. | ||
final int nodePosition = getNodePosition(node); | ||
if (nodePosition > 0) { | ||
value.append(String.format("/processing-instruction(%s)[%d]", node.getNodeName(), nodePosition)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same position question
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dizzzz This is passing all XQTS tests for fn-path
how to deal with #1463 ? It caused me to hold my PR.... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, some smaller questions
@chris-evolvedbinary Also could you please use the prefixes in your commit messages. If you look at the commit log you will see we use prefixes like [bugfix], [feature], [test], [refactor], etc. |
afd088f
to
68f8574
Compare
68f8574
to
ec80946
Compare
SonarCloud Quality Gate failed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now it looks good to me :-)
Before eXist 6.1.0, eXist’s implementation of the fn:root() function contained a bug that caused it to always return a document node, even when called on an in-memory node whose root node was an element node. This bug was fixed in eXist-db/exist#4402. The only code in hsg-shell that assumed the buggy behavior was the code that handled the display of concurrent appointments in POCOM data. After upgrading HSG from 5.1.1 to 6.2.0, this code triggered an error.
Implementation of the
fn:path()
function. This implementation requires fixing an issue with document nodes.Reference:
Type of tests:
exist-core/src/test/xquery/xquery3/fnPath.xqm
--
This open source contribution to the eXist-db project was commissioned by the Office of the Historian, U.S. Department of State, https://history.state.gov/.