public final List<Node> extractFragment(final Configuration configuration, final List<Node> nodes) {
DOMSelector selector = null;
ICache<String,Object> expressionCache = null;
final ICacheManager cacheManager = configuration.getCacheManager();
if (cacheManager != null) {
expressionCache = cacheManager.getExpressionCache();
if (expressionCache != null) {
selector = (DOMSelector) expressionCache.get(this.domSelectorCacheKey);
}
}
if (selector == null) {
selector = new DOMSelector(this.selectorExpression);
if (expressionCache != null) {
expressionCache.put(this.domSelectorCacheKey, selector);
}
}
final DOMSelector.INodeReferenceChecker referenceChecker = getReferenceChecker(configuration);
final List<Node> extraction = selector.select(nodes, referenceChecker);
if (extraction == null || extraction.size() == 0) {
return null;
}