-
Notifications
You must be signed in to change notification settings - Fork 15
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
518: Add transitive-closure() function #521
Conversation
<fos:example> | ||
<fos:test use="transitive-closure-data"> | ||
<fos:expression>transitive-closure($data//person[@id=2], function{//person[@manager]=@id})/string(@id)</fos:expression> | ||
<fos:result>("3", "4", "6")</fos:result> |
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.
Should the result ("3", "4", "6") contain "6"? Person 6's manager is 3, not 2.
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.
Ah, I think I get it. With the first iteration, we get persons who have 2 as a manager (persons 3 and 4), and with the following iteration we get all people who have 3 or 4 as a manager (person 6) - and thus the answer is 3, 4, and 6. (I'd been misreading the context for //person
as $data/person[@id = 2]
, whereas in fact it's all of $data
.)
The CG accepted this PR at meeting 038 |
Closes issue #518 |
No description provided.