Check the list of selector <em>parts</em> and return a set of nodes with the result.

@param parts A list of selector <em>parts</em>.
@return A set of nodes.
@throws NodeSelectorException In case of an error.
509478
private Collection<Node> check(final Collection<Selector> parts) throws NodeSelectorException {
		Collection<Node> result = new LinkedHashSet<Node>();
		result.add(root);

		boolean initialPart=true;
		for (Selector selector : parts) {
			Checker<Node> checker = new TagChecker<Node>(helper, selector, initialPart);
			result = checker.check(result);
			if (selector.hasSpecifiers())
				for (Specifier specifier : selector.getSpecifiers()) {
					switch (specifier.getType()) {
					case ATTRIBUTE:
						checker = new AttributeSpecifierChecker<Node>(helper, (AttributeSpecifier) specifier);
						break;
					case PSEUDO:
						if (specifier instanceof PseudoClassSpecifier)
							checker = new PseudoClassSpecifierChecker<Node>(helper, (PseudoClassSpecifier) specifier);
						else if (specifier instanceof PseudoNthSpecifier)
							checker = new PseudoNthSpecifierChecker<Node>(helper, (PseudoNthSpecifier) specifier);
						else if (specifier instanceof PseudoContainsSpecifier)
							checker = new PseudoContainsSpecifierChecker<Node>(helper, (PseudoContainsSpecifier) specifier);

						break;

					case NEGATION:
						final Collection<Node> negationNodes = checkNegationSpecifier((NegationSpecifier) specifier);
						checker = new Checker<Node>() {
							@Override
							public List<Node> check(final Collection<Node> nodes) {
								Collection<Node> set = new LinkedHashSet<Node>(nodes);
								set.removeAll(negationNodes);
								return new ArrayList<Node>(set);
							}
						};
						break;
					}

					result = checker.check(result);
					if (result.isEmpty())
						// Bail out early.
						return result;
				}
			initialPart=false;
		}

		return result;
	}
1291352
public static NodeList getElementsB(Node node, String xString) throws XPathExpressionException {
        XPathExpression xPath = compileX(xString);
        return (NodeList) xPath.evaluate(node, XPathConstants.NODESET);
    }
1067601
function getSelector(node) {
  var selector = arguments.length <= 1 || arguments[1] === undefined ? [node.name] : arguments[1];

  var parent = node.parent;
  if (parent) {
    var children = parent.children;
    var matches = children.filter(function (child) {
      return child.name === node.name;
    });
    if (matches.length > 1) {
      for (var i = 0, l = matches.length; i < l; i++) {
        if (matches[i] === node) {
          selector[0] = selector[0] + ':nth-of-type(' + (i + 1) + ')';
          break;
        }
      }
    }
    selector.unshift(parent.name);
  }
  return parent && parent.parent ? getSelector(parent, selector) : selector.join(' > ');
}
131783
public static Node selectNode(Node dom, String xpath) {
        return selector.selectNode(dom, xpath);
    }
764343
public NodeIterator nodeset() throws javax.xml.transform.TransformerException
  {

    error(XPATHErrorResources.ER_CANT_CONVERT_TO_NODELIST,
          new Object[]{ getTypeString() });  //"Can not convert "+getTypeString()+" to a NodeList!");

    return null;
  }
46298
public static Partitions parse(String nodes) {
        Partitions result = new Partitions();

        try {
            List<RedisClusterNode> mappedNodes = TOKEN_PATTERN.splitAsStream(nodes).filter(s -> !s.isEmpty())
                    .map(ClusterPartitionParser::parseNode).collect(Collectors.toList());
            result.addAll(mappedNodes);
        } catch (Exception e) {
            throw new RedisException("Cannot parse " + nodes, e);
        }

        return result;
    }
851864
public void setSelectors(java.util.Collection<Selector> selectors) {
        if (selectors == null) {
            this.selectors = null;
            return;
        }

        this.selectors = new com.amazonaws.internal.SdkInternalList<Selector>(selectors);
    }
714290
public Selector parseSelector(String selectorString,
                                SelectorDomain domain) throws SISelectorSyntaxException
  {
    if (tc.isEntryEnabled())
      SibTr.entry(tc, "parseSelector", new Object[] { selectorString, domain });
    
    Selector selectorTree = mpm.parseSelector(selectorString, domain);
       
    if (tc.isEntryEnabled()) SibTr.exit(tc, "parseSelector", selectorTree);
    return selectorTree;       
  }
490500
public java.util.List<Selector> getSelectors() {
        if (selectors == null) {
            selectors = new com.amazonaws.internal.SdkInternalList<Selector>();
        }
        return selectors;
    }
118961
private NodeList getNodeList(String document, XPathExpression expression) throws Exception
   {
      Document doc = m_documentBuilder.parse(new InputSource(new StringReader(document)));
      return (NodeList) expression.evaluate(doc, XPathConstants.NODESET);
   }
236249
public List<ElementType<AnnotationType<T>>> getAllElement()
   {
      List<ElementType<AnnotationType<T>>> list = new ArrayList<ElementType<AnnotationType<T>>>();
      List<Node> nodeList = childNode.get("element");
      for(Node node: nodeList)
      {
         ElementType<AnnotationType<T>>  type = new ElementTypeImpl<AnnotationType<T>>(this, "element", childNode, node);
         list.add(type);
      }
      return list;
   }
871976
public Selector getSelector(String selector) 
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      tc.entry(cclass,
               "getSelector",
               "selector: " + selector);	  
  	// Start by parsing the selector expression (in-line for the moment)
  	selOperands = new ArrayList();
    // We'll Construct a selector tree
    Selector selectorTree = null;
    
    try
    {
      parseSelector(selector);

      Selector[] selectorArray = new Selector[selOperands.size()];
      selOperands.toArray(selectorArray);
 	
      // Iterate over the nodes that were passed into us
      for(int i = selectorArray.length - 1 ; i>=0; i--)
      {
        Selector parsedSelector = (Selector)selectorArray[i];
        if(selectorTree == null)
          selectorTree = parsedSelector;
        else
          selectorTree = matching.createExtensionOperator(Selector.AND, parsedSelector, selectorTree);
      }
    }
    catch(InvalidXPathSyntaxException iex)
    {
      // No FFDC Code Needed.
      if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
        tc.debug(this,cclass, "getSelector", iex);   

      // Attempt to parse the entire selector expression. If that fails, then
      // we really can despair of handling this expression.
      selectorTree = parseWholeSelector(selector);
    }
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
        tc.exit(this,cclass, "getSelector", selectorTree);  
    
    return selectorTree;
  }
1131519
public B partialFilterSelector(Selector selector) {
        instance.def.selector = Helpers.getJsonObjectFromSelector(selector);
        return returnThis();
    }
247066
public Collection<Part> getParts() throws IOException {
        if (!_parsed)
            parse();
        throwIfError();

        Collection<List<Part>> values = _parts.values();
        List<Part> parts = new ArrayList<>();
        for (List<Part> o : values) {
            List<Part> asList = LazyList.getList(o, false);
            parts.addAll(asList);
        }
        return parts;
    }
1334601
function partNode(node){
      if (node.isPart && node.childNodes.length == 1 && node.firstChild.nodeType == 3) {
        node.currentText = node.firstChild.nodeValue;
        return !/[\n\t\r]/.test(node.currentText);
      }
      return false;
    }
310237
public Selector parseSelector(String selectorString,
                                SelectorDomain domain)
    throws SISelectorSyntaxException
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.entry(tc, "parseSelector", new Object[] { selectorString, domain });

    Selector selectorTree = null;
    Transformer transformer = Matching.getTransformer();
    Resolver resolver = null;

    try
    {
      // Synchronization block to protect the parser object from being reset
      // whilst in use.
      synchronized (this)
      {
        MatchParser parser = null;
        if(domain.equals(SelectorDomain.JMS))
        {
          // Set the correct resolver
          resolver = _jmsResolver;
          // Drive the parser
          _sibParser = _matching.primeMatchParser(_sibParser,
                                             selectorString,
                                             SelectorDomain.JMS.toInt());
          parser = _sibParser;
        }
        else if(domain.equals(SelectorDomain.SIMESSAGE))
        {
          // Set the correct resolver
          resolver = _simessageResolver;
          // Drive the parser
          _sibParser = _matching.primeMatchParser(_sibParser,
                                             selectorString,
                                             SelectorDomain.SIMESSAGE.toInt());
          parser = _sibParser;
        }
        else // In the XPath1.0 case we use the default resolver
        {
          // Set the correct resolver
          resolver = _defaultResolver;
          // Drive the parser
          _xpathParser = _matching.primeMatchParser(_xpathParser,
                                             selectorString,
                                             SelectorDomain.XPATH1.toInt());
          parser = _xpathParser;
        }

        // We're ready to parse the selector
        if(disableXPathOptimizer && domain.equals(SelectorDomain.XPATH1))
        {
          // In this special case we'll disable the MatchSpace XPath
          // optimizations and process XPath expressions as whole entities.
          XPath10Parser xpParser = (XPath10Parser)parser;
          selectorTree = xpParser.parseWholeSelector(selectorString);
        }
        else
        {
          // Parse in the usual manner
          selectorTree = parser.getSelector(selectorString);
        }

        // Check that the selector parsed ok.
        if (selectorTree.getType() == Selector.INVALID)
        {
                if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
                  SibTr.exit(tc, "parseSelector", "SISelectorSyntaxException");
          throw new SISelectorSyntaxException(
            nls.getFormattedMessage(
              "INVALID_SELECTOR_ERROR_CWSIP0371",
              new Object[] { selectorString },
              null));
        }

        selectorTree = transformer.resolve(selectorTree, resolver, _positionAssigner);

        // Check that the selector resolved ok.
        if (selectorTree.getType() == Selector.INVALID)
        {
          if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(tc, "parseSelector", "SISelectorSyntaxException");
          throw new SISelectorSyntaxException(
            nls.getFormattedMessage(
              "INVALID_SELECTOR_ERROR_CWSIP0371",
              new Object[] { selectorString },
              null));
        }
      }
    }
    catch (RuntimeException e)
    {
      // FFDC
      FFDCFilter.processException(
        e,
        "com.ibm.ws.sib.processor.matching.MessageProcessorMatching.parseSelector",
        "1:1741:1.117.1.11",
        this);

      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
        SibTr.exit(tc, "parseSelector", "SISelectorSyntaxException");

      throw new SISelectorSyntaxException(
        nls.getFormattedMessage(
          "INVALID_SELECTOR_ERROR_CWSIP0371",
          new Object[] { null },
          null));
    }
    catch (MatchingException e)
    {
      // No FFDC code needed

      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
        SibTr.exit(tc, "parseSelector", "SISelectorSyntaxException");

      throw new SISelectorSyntaxException(
        nls.getFormattedMessage(
          "INVALID_SELECTOR_ERROR_CWSIP0376",
          new Object[] { e },
          null));
    }
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "parseSelector", selectorTree);
    return selectorTree;
  }
168281
private @Nonnull NodeList evaluate(String xpath) {
        try {
            XPathExpression expr = xpf.newXPath().compile(xpath);
            return (NodeList) expr.evaluate(node, XPathConstants.NODESET);
        } catch (XPathExpressionException ex) {
            throw new IllegalArgumentException("Invalid XPath '" + xpath + "'", ex);
        }
    }