/*
 * @author Ranides Atterwim <ranides@gmail.com>
 * @copyright Ranides Atterwim
 * @license WTFPL
 * @url http://ranides.net/projects/assira
 */

package net.ranides.assira.xml;

import java.util.function.Function;
import java.util.function.Predicate;
import net.ranides.assira.xml.impl.W3Selectors;

/**
 *
 * @author Ranides Atterwim <ranides@gmail.com>
 */
public interface XMLSelector extends Function<XMLContext, XMLElements>, Predicate<XMLContext> {

    @Override
    XMLElements apply(XMLContext context);

    @Override
    boolean test(XMLContext context);

    static XMLSelector compile(String selector) {
        return W3Selectors.compile(selector);
    }
    
    static XMLSelector css(String selector) {
        return W3Selectors.css(selector);
    }
    
    static XMLSelector xpath(String selector) {
        return W3Selectors.xpath(selector);
    }
    
}
