/** * @see <a href="https://issues.apache.org/jira/browse/TIKA-210">TIKA-210</a> */ @Override public void characters(char[] ch, int start, int length) throws SAXException { lazyEndHead(useFrameset); super.characters(ch, start, length); }
@Override public void ignorableWhitespace(char[] ch, int start, int length) throws SAXException { advance(length); super.ignorableWhitespace(ch, start, length); }
@Override public void characters(char[] ch, int start, int length) throws SAXException { advance(length); super.characters(ch, start, length); }
public void parse( InputStream stream, ContentHandler handler, Metadata metadata, ParseContext context) throws SAXException { XHTMLContentHandler xhtml = new XHTMLContentHandler(handler, metadata); xhtml.startDocument(); xhtml.endDocument(); } }
private void writeKeyword(String keyword) throws SAXException { xhtml.startElement("span", "class", "java-keyword"); xhtml.characters(keyword); xhtml.endElement("span"); }
@Override public void hyperlinkStart(String link) { try { if (link != null) { xhtml.startElement("a", "href", link); wroteHyperlinkStart = true; } } catch (SAXException e) { } }
public HtmlHandler( HtmlMapper mapper, ContentHandler handler, Metadata metadata, ParseContext context, boolean extractScripts) { this(mapper, new XHTMLContentHandler(handler, metadata), metadata, context, extractScripts); }
public void endRow(int rowNum) { try { xhtml.endElement("tr"); } catch (SAXException e) { } }
@Override public void characters(char[] ch, int start, int length) throws SAXException { if (parseText && length > 0) { xhtml.characters(ch, start, length); } }
/** * Starts an XMP document by setting up the namespace mappings and * writing out the following header: * <pre> * <rdf:RDF> * </pre> */ @Override public void startDocument() throws SAXException { super.startDocument(); startPrefixMapping("rdf", RDF); startPrefixMapping("xmp", XMP); startElement(RDF, "RDF", "rdf:RDF", EMPTY_ATTRIBUTES); }
/** * Ends the XMP document by writing the following footer and * clearing the namespace mappings: * <pre> * </rdf:RDF> * </pre> */ @Override public void endDocument() throws SAXException { endElement(RDF, "RDF", "rdf:RDF"); endPrefixMapping("xmp"); endPrefixMapping("rdf"); super.endDocument(); }
/** * Starts an XHTML document by setting up the namespace mappings * when called for the first time. * The standard XHTML prefix is generated lazily when the first * element is started. */ @Override public void startDocument() throws SAXException { if(!documentStarted){ documentStarted = true; super.startDocument(); startPrefixMapping("", XHTML); } }
/** * Writes the given character as-is. * * @param ch character to be written * @throws SAXException if the character could not be written */ protected void write(char ch) throws SAXException { super.characters(new char[] { ch }, 0, 1); }
@Override public void startDocument() throws SAXException { super.startDocument(); isTitleTagOpen = false; }
/** * Tags any {@link SAXException}s thrown, wrapping and re-throwing. * * @param e The SAXException thrown * @throws SAXException if an XML error occurs */ @Override protected void handleException(SAXException e) throws SAXException { throw new TaggedSAXException(e, this); }
/** * This is called before parsing an embedded document * * @param contentHandler - local content handler to use on the embedded document * @param metadata metadata to use for the embedded document * @throws SAXException */ @Override public void startEmbeddedDocument(ContentHandler contentHandler, Metadata metadata) throws SAXException { super.startEmbeddedDocument(contentHandler, metadata); }
@Override public void startTableRow() { try { xhtml.startElement("tr"); } catch (SAXException e) { } }
@Override public void endTable() { try { xhtml.endElement("table"); tableDepth--; } catch (SAXException e) { } }
@Override public void startTableCell() { try { xhtml.startElement("td"); } catch (SAXException e) { } tableCellDepth++; }
@Override public void startTable() { try { xhtml.startElement("table"); tableDepth++; } catch (SAXException e) { } }