/** * Document parser. * @param source Source content stream to be parsed. * @return W3C ownerDocument. * @throws SAXException Unable to parse the content. * @throws IOException Unable to read the input stream. */ public Document parse(Source source) throws IOException, SAXException { DOMBuilder contentHandler = new DOMBuilder(getExecContext()); parse(source, contentHandler); return contentHandler.getDocument(); }
public void ignorableWhitespace(char[] ch, int start, int length) throws SAXException { characters(ch, start, length); }
@SuppressWarnings("RedundantThrows") public void endElement(EndElementEvent endEvent) throws SAXException { String elName; if(endEvent.qName != null && !endEvent.qName.equals("")) { elName = endEvent.qName; }else { elName = endEvent.localName; } if(!emptyElements.contains(elName)) { int index = getIndex(elName); if(index != -1) { nodeStack.setSize(index); } else { logger.debug("Ignoring unexpected end [" + endEvent.localName + "] element event. Request: [" + execContext.getDocumentSource() + "] - document location: [" + getCurPath() + "]"); } } }
/** * Append the content, behind the supplied input stream, to suplied * document element. * <p/> * Used to merge document fragments into a document. * @param source Source content stream to be parsed. * @param appendElement DOM element to which the content fragment is to * be added. * @throws SAXException Unable to parse the content. * @throws IOException Unable to read the input stream. */ public void append(Source source, Element appendElement) throws IOException, SAXException { DOMBuilder contentHandler = new DOMBuilder(getExecContext()); contentHandler.setAppendElement(appendElement); parse(source, contentHandler); }
public DOMBuilder(ExecutionContext execContext, SmooksContentHandler parentContentHandler) { super(execContext, parentContentHandler); this.execContext = execContext; initialiseEmptyElements(); rewriteEntities = ParameterAccessor.getBoolParameter(Filter.ENTITIES_REWRITE, true, execContext.getDeliveryConfig()); }
contentHandler.detachHandler();
@SuppressWarnings("RedundantThrows") public void endElement(EndElementEvent endEvent) throws SAXException { String elName; if(endEvent.qName != null && !endEvent.qName.equals("")) { elName = endEvent.qName; }else { elName = endEvent.localName; } if(!emptyElements.contains(elName)) { int index = getIndex(elName); if(index != -1) { nodeStack.setSize(index); } else { logger.debug("Ignoring unexpected end [" + endEvent.localName + "] element event. Request: [" + execContext.getDocumentSource() + "] - document location: [" + getCurPath() + "]"); } } }
/** * Append the content, behind the supplied input stream, to suplied * document element. * <p/> * Used to merge document fragments into a document. * @param source Source content stream to be parsed. * @param appendElement DOM element to which the content fragment is to * be added. * @throws SAXException Unable to parse the content. * @throws IOException Unable to read the input stream. */ public void append(Source source, Element appendElement) throws IOException, SAXException { DOMBuilder contentHandler = new DOMBuilder(getExecContext()); contentHandler.setAppendElement(appendElement); parse(source, contentHandler); }
public DOMBuilder(ExecutionContext execContext, SmooksContentHandler parentContentHandler) { super(execContext, parentContentHandler); this.execContext = execContext; initialiseEmptyElements(); rewriteEntities = ParameterAccessor.getBoolParameter(Filter.ENTITIES_REWRITE, true, execContext.getDeliveryConfig()); }
contentHandler.detachHandler();
/** * Document parser. * @param source Source content stream to be parsed. * @return W3C ownerDocument. * @throws SAXException Unable to parse the content. * @throws IOException Unable to read the input stream. */ public Document parse(Source source) throws IOException, SAXException { DOMBuilder contentHandler = new DOMBuilder(getExecContext()); parse(source, contentHandler); return contentHandler.getDocument(); }
public void endElement(EndElementEvent endEvent) throws SAXException { String elName; if(endEvent.qName != null && !endEvent.qName.equals("")) { elName = endEvent.qName; }else { elName = endEvent.localName; } if(!emptyElements.contains(elName)) { int index = getIndex(elName); if(index != -1) { nodeStack.setSize(index); } else { logger.debug("Ignoring unexpected end [" + endEvent.localName + "] element event. Request: [" + execContext.getDocumentSource() + "] - document location: [" + getCurPath() + "]"); } } }
/** * Append the content, behind the supplied input stream, to suplied * document element. * <p/> * Used to merge document fragments into a document. * @param source Source content stream to be parsed. * @param appendElement DOM element to which the content fragment is to * be added. * @throws SAXException Unable to parse the content. * @throws IOException Unable to read the input stream. */ public void append(Source source, Element appendElement) throws IOException, SAXException { DOMBuilder contentHandler = new DOMBuilder(getExecContext()); contentHandler.setAppendElement(appendElement); parse(source, contentHandler); }
public DOMBuilder(ExecutionContext execContext, SmooksContentHandler parentContentHandler) { super(execContext, parentContentHandler); this.execContext = execContext; initialiseEmptyElements(); rewriteEntities = ParameterAccessor.getBoolParameter(Filter.ENTITIES_REWRITE, true, execContext.getDeliveryConfig()); }
public void ignorableWhitespace(char[] ch, int start, int length) throws SAXException { characters(ch, start, length); }
contentHandler.detachHandler();
/** * Document parser. * @param source Source content stream to be parsed. * @return W3C ownerDocument. * @throws SAXException Unable to parse the content. * @throws IOException Unable to read the input stream. */ public Document parse(Source source) throws IOException, SAXException { DOMBuilder contentHandler = new DOMBuilder(getExecContext()); parse(source, contentHandler); return contentHandler.getDocument(); }
@SuppressWarnings("RedundantThrows") public void endElement(EndElementEvent endEvent) throws SAXException { String elName; if(endEvent.qName != null && !endEvent.qName.equals("")) { elName = endEvent.qName; }else { elName = endEvent.localName; } if(!emptyElements.contains(elName)) { int index = getIndex(elName); if(index != -1) { nodeStack.setSize(index); } else { logger.debug("Ignoring unexpected end [" + endEvent.localName + "] element event. Request: [" + execContext.getDocumentSource() + "] - document location: [" + getCurPath() + "]"); } } }
/** * Append the content, behind the supplied input stream, to suplied * document element. * * Used to merge document fragments into a document. * @param source Source content stream to be parsed. * @param appendElement DOM element to which the content fragment is to * be added. * @throws SAXException Unable to parse the content. * @throws IOException Unable to read the input stream. */ public void append(Source source, Element appendElement) throws IOException, SAXException { DOMBuilder contentHandler = new DOMBuilder(getExecContext()); contentHandler.setAppendElement(appendElement); parse(source, contentHandler); }
public DOMBuilder(ExecutionContext execContext, SmooksContentHandler parentContentHandler) { super(execContext, parentContentHandler); this.execContext = execContext; initialiseEmptyElements(); rewriteEntities = ParameterAccessor.getBoolParameter(Filter.ENTITIES_REWRITE, true, execContext.getDeliveryConfig()); }