Skip to content

Commit

Permalink
WIP - Address context issues in selectors
Browse files Browse the repository at this point in the history
  • Loading branch information
adamretter committed Nov 2, 2024
1 parent 9706516 commit 6063107
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -103,13 +103,19 @@ public FollowingSiblingSelector(final NodeSet contextSet, final int contextId, @
for (final NodeProxy contextNode : precedingSiblings) {
// System.out.println("\t\tSTART INNER LOOP: " + i);

if (Expression.NO_CONTEXT_ID == contextId) {
// System.out.println("\t\t\t" + followingSibling.getNodeId().toString() + " .copyContext(" + contextNode.getNodeId().toString() + ")");
followingSibling.copyContext(contextNode);
} else {
// System.out.println("\t\t\t" + followingSibling.getNodeId().toString() + " .addContextNode(" + contextId + ", " + contextNode.getNodeId().toString() + ")");
followingSibling.addContextNode(contextId, contextNode);
}
// START TEMP
if (followingSibling.getContext() == null || contextNode.getContext() == null
|| followingSibling.getContext().getContextId() != contextNode.getContext().getContextId()) {

if (Expression.NO_CONTEXT_ID == contextId) {
// System.out.println("\t\t\t" + followingSibling.getNodeId().toString() + " .copyContext(" + contextNode.getNodeId().toString() + ")");
followingSibling.copyContext(contextNode);
} else {
// System.out.println("\t\t\t" + followingSibling.getNodeId().toString() + " .addContextNode(" + contextId + ", " + contextNode.getNodeId().toString() + ")");
followingSibling.addContextNode(contextId, contextNode);
}

} // END TEMP

// System.out.println("\t\tEND INNER LOOP: " + i);
// i++;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,13 +138,19 @@ public PrecedingSiblingSelector(final NodeSet contextSet, final int contextId, @
for (final NodeProxy precedingSibling : precedingSiblings) {
// System.out.println("\t\tSTART INNER LOOP: " + i);

if (Expression.NO_CONTEXT_ID == contextId) {
// START TEMP
if (precedingSibling.getContext() == null || followingSibling.getContext() == null
|| precedingSibling.getContext().getContextId() != followingSibling.getContext().getContextId()) {

if (Expression.NO_CONTEXT_ID == contextId) {
// System.out.println("\t\t\t" + precedingSibling.getNodeId().toString() + " .copyContext(" + followingSibling.getNodeId().toString() + ")");
precedingSibling.copyContext(followingSibling);
} else {
precedingSibling.copyContext(followingSibling);
} else {
// System.out.println("\t\t\t" + precedingSibling.getNodeId().toString() + " .addContextNode(" + contextId + ", " + followingSibling.getNodeId().toString() + ")");
precedingSibling.addContextNode(contextId, followingSibling);
}
precedingSibling.addContextNode(contextId, followingSibling);
}

} // END TEMP

// System.out.println("\t\tEND INNER LOOP: " + i);
// i++;
Expand Down

0 comments on commit 6063107

Please sign in to comment.