org.apache.tika.parser.odf
Class NSNormalizerContentHandler
java.lang.Object
org.xml.sax.helpers.DefaultHandler
org.apache.tika.sax.ContentHandlerDecorator
org.apache.tika.parser.odf.NSNormalizerContentHandler
- All Implemented Interfaces:
- ContentHandler, DTDHandler, EntityResolver, ErrorHandler
public class NSNormalizerContentHandler
- extends ContentHandlerDecorator
Content handler decorator that:
- Maps old OpenOffice 1.0 Namespaces to the OpenDocument ones
- Returns a fake DTD when parser requests OpenOffice DTD
Methods inherited from class org.apache.tika.sax.ContentHandlerDecorator |
characters, endDocument, endPrefixMapping, handleException, ignorableWhitespace, processingInstruction, setContentHandler, setDocumentLocator, skippedEntity, startDocument, toString |
Methods inherited from class org.xml.sax.helpers.DefaultHandler |
error, fatalError, notationDecl, unparsedEntityDecl, warning |
NSNormalizerContentHandler
public NSNormalizerContentHandler(ContentHandler handler)
startElement
public void startElement(String namespaceURI,
String localName,
String qName,
Attributes atts)
throws SAXException
- Specified by:
startElement
in interface ContentHandler
- Overrides:
startElement
in class ContentHandlerDecorator
- Throws:
SAXException
endElement
public void endElement(String namespaceURI,
String localName,
String qName)
throws SAXException
- Specified by:
endElement
in interface ContentHandler
- Overrides:
endElement
in class ContentHandlerDecorator
- Throws:
SAXException
startPrefixMapping
public void startPrefixMapping(String prefix,
String uri)
throws SAXException
- Specified by:
startPrefixMapping
in interface ContentHandler
- Overrides:
startPrefixMapping
in class ContentHandlerDecorator
- Throws:
SAXException
resolveEntity
public InputSource resolveEntity(String publicId,
String systemId)
throws IOException,
SAXException
- do not load any DTDs (may be requested by parser). Fake the DTD by
returning a empty string as InputSource
- Specified by:
resolveEntity
in interface EntityResolver
- Overrides:
resolveEntity
in class org.xml.sax.helpers.DefaultHandler
- Throws:
IOException
SAXException
Copyright © 2007-2012 The Apache Software Foundation. All Rights Reserved.