public Node filter(Document doc) { Node deliveryNode; // Apply assembly phase... if (doc.getDocumentElement() == null) { logger.debug("Empty Document [" + executionContext.getDocumentSource() + "]. Not performaing any processing."); return doc; } deliveryNode = filter(doc.getDocumentElement()); if (deliveryNode == null) { deliveryNode = doc; } return deliveryNode; }
/** * Filter the supplied W3C Document. * <p/> * Executes the <a href="#phases">Assembly & Processing phases</a>. * * @param doc The W3C Document to be filtered. * @return Node representing filtered document. */ public Node filter(Document doc) { Node deliveryNode; // Apply assembly phase... if (doc.getDocumentElement() == null) { logger.debug("Empty Document [" + executionContext.getDocumentSource() + "]. Not performaing any processing."); return doc; } deliveryNode = filter(doc.getDocumentElement()); if (deliveryNode == null) { deliveryNode = doc; } return deliveryNode; }
/** * Filter the supplied W3C Document. * <p/> * Executes the <a href="#phases">Assembly & Processing phases</a>. * * @param doc The W3C Document to be filtered. * @return Node representing filtered document. */ public Node filter(Document doc) { Node deliveryNode; // Apply assembly phase... if (doc.getDocumentElement() == null) { logger.debug("Empty Document [" + executionContext.getDocumentSource() + "]. Not performaing any processing."); return doc; } deliveryNode = filter(doc.getDocumentElement()); if (deliveryNode == null) { deliveryNode = doc; } return deliveryNode; }
/** * Filter the supplied W3C Document. * <p/> * Executes the <a href="#phases">Assembly & Processing phases</a>. * * @param doc The W3C Document to be filtered. * @return Node representing filtered document. */ public Node filter(Document doc) { Node deliveryNode; // Apply assembly phase... if (doc.getDocumentElement() == null) { logger.debug("Empty Document [" + executionContext.getDocumentSource() + "]. Not performaing any processing."); return doc; } deliveryNode = filter(doc.getDocumentElement()); if (deliveryNode == null) { deliveryNode = doc; } return deliveryNode; }
Node node = ((DOMSource) source).getNode(); if ((node instanceof Document)) { resultNode = filter((Document) node); } else if ((node instanceof Element)) { resultNode = filter((Element) node); } else { throw new IllegalArgumentException("DOMSource Source types must contain a Document or Element node."); resultNode = filter(source);
Node node = ((DOMSource) source).getNode(); if ((node instanceof Document)) { resultNode = filter((Document) node); } else if ((node instanceof Element)) { resultNode = filter((Element) node); } else { throw new IllegalArgumentException("DOMSource Source types must contain a Document or Element node."); resultNode = filter(source);
Node node = ((DOMSource) source).getNode(); if ((node instanceof Document)) { resultNode = filter((Document) node); } else if ((node instanceof Element)) { resultNode = filter((Element) node); } else { throw new IllegalArgumentException("DOMSource Source types must contain a Document or Element node."); resultNode = filter(source);
Node node = ((DOMSource) source).getNode(); if ((node instanceof Document)) { resultNode = filter((Document) node); } else if ((node instanceof Element)) { resultNode = filter((Element) node); } else { throw new IllegalArgumentException("DOMSource Source types must contain a Document or Element node."); resultNode = filter(source);
public Node filter(Source source) throws SmooksException { Node deliveryNode; if (source == null) { throw new IllegalArgumentException("null 'source' arg passed in method call."); } try { DOMParser parser = new DOMParser(executionContext); Document document = parser.parse(source); deliveryNode = filter(document); } catch (Exception cause) { throw new SmooksException("Unable to filter InputStream for target profile [" + executionContext.getTargetProfiles().getBaseProfile() + "].", cause); } return deliveryNode; }
/** * Phase the supplied input reader. * <p/> * Simply parses the input reader into a W3C DOM and calls {@link #filter(Document)}. * * @param source The source of markup to be filtered. * @return Node representing filtered document. */ public Node filter(Source source) { Node deliveryNode; if (source == null) { throw new IllegalArgumentException("null 'source' arg passed in method call."); } try { DOMParser parser = new DOMParser(executionContext); Document document = parser.parse(source); deliveryNode = filter(document); } catch (Exception cause) { throw new SmooksException("Unable to filter InputStream for target profile [" + executionContext.getTargetProfiles().getBaseProfile() + "].", cause); } return deliveryNode; }
/** * Phase the supplied input reader. * <p/> * Simply parses the input reader into a W3C DOM and calls {@link #filter(Document)}. * * @param source The source of markup to be filtered. * @return Node representing filtered document. */ public Node filter(Source source) { Node deliveryNode; if (source == null) { throw new IllegalArgumentException("null 'source' arg passed in method call."); } try { DOMParser parser = new DOMParser(executionContext); Document document = parser.parse(source); deliveryNode = filter(document); } catch (Exception cause) { throw new SmooksException("Unable to filter InputStream for target profile [" + executionContext.getTargetProfiles().getBaseProfile() + "].", cause); } return deliveryNode; }
/** * Phase the supplied input reader. * <p/> * Simply parses the input reader into a W3C DOM and calls {@link #filter(Document)}. * * @param source The source of markup to be filtered. * @return Node representing filtered document. */ public Node filter(Source source) { Node deliveryNode; if (source == null) { throw new IllegalArgumentException("null 'source' arg passed in method call."); } try { DOMParser parser = new DOMParser(executionContext); Document document = parser.parse(source); deliveryNode = filter(document); } catch (Exception cause) { throw new SmooksException("Unable to filter InputStream for target profile [" + executionContext.getTargetProfiles().getBaseProfile() + "].", cause); } return deliveryNode; }