Skip to content

Commit

Permalink
Remove comments that don't apply anymore and review language on others
Browse files Browse the repository at this point in the history
  • Loading branch information
ggalmazor committed Mar 10, 2020
1 parent b78b984 commit 9c4f09f
Showing 1 changed file with 1 addition and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -306,31 +306,22 @@ public TreeReference anchor(TreeReference baseReference) throws XPathException {
}

public TreeReference contextualize(TreeReference contextRef) {
//TODO: Technically we should possibly be modifying context stuff here
//instead of in the xpath stuff;
if (!contextRef.isAbsolute()) {
return null;
}

// I think contextualizing of absolute nodes still needs to be done.
// They may contain predicates that need to be contextualized.

TreeReference newRef = anchor(contextRef);
// unclear...
newRef.setContext(contextRef.getContext());

//apply multiplicities and fill in wildcards as necessary based on the context ref
for (int i = 0; i < contextRef.size() && i < newRef.size(); i++) {

//If the the contextRef can provide a definition for a wildcard, do so
//If the the contextRef can provide a definition for a wildcard (not currently supported by JR), do so
if (TreeReference.NAME_WILDCARD.equals(newRef.getName(i)) && !TreeReference.NAME_WILDCARD.equals(contextRef.getName(i))) {
newRef.data.set(i, newRef.data.get(i).setName(contextRef.getName(i)));
}

if (contextRef.getName(i).equals(newRef.getName(i))) {
//We can't actually merge nodes if the newRef has predicates or filters
//on this expression, since those reset any existing resolutions which
//may have been done.
if (newRef.getPredicate(i) == null) {
List<XPathExpression> predicate = contextRef.getPredicate(i);
newRef.addPredicate(i, predicate);
Expand Down

0 comments on commit 9c4f09f

Please sign in to comment.