private void addVariableAsTargetIfMatches( XQueryVarDecl variableDeclaration, String checkedNamespace) { if (variableDeclarationWithValidName(variableDeclaration)) { XQueryQName<XQueryVarName> source = aXQueryQName(myElement.getVarName()).withPrefix(checkedNamespace).build(); XQueryQName<XQueryVarName> checkedQName = aXQueryQName(variableDeclaration.getVarName()).build(); if (source.equals(checkedQName)) { matchingVariableNames.add(checkedQName.getNamedObject()); } } }
private boolean variableDeclarationWithValidName(XQueryVarDecl varDecl) { return varDecl.getVarName() != null && varDecl.getVarName().getTextLength() > 0; }