Package 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:
org.xml.sax.ContentHandler
,org.xml.sax.DTDHandler
,org.xml.sax.EntityResolver
,org.xml.sax.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
-
-
Constructor Summary
Constructors Constructor Description NSNormalizerContentHandler(org.xml.sax.ContentHandler handler)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
endElement(java.lang.String namespaceURI, java.lang.String localName, java.lang.String qName)
org.xml.sax.InputSource
resolveEntity(java.lang.String publicId, java.lang.String systemId)
do not load any DTDs (may be requested by parser).void
startElement(java.lang.String namespaceURI, java.lang.String localName, java.lang.String qName, org.xml.sax.Attributes atts)
void
startPrefixMapping(java.lang.String prefix, java.lang.String uri)
-
Methods inherited from class org.apache.tika.sax.ContentHandlerDecorator
characters, endDocument, endPrefixMapping, ignorableWhitespace, processingInstruction, setDocumentLocator, skippedEntity, startDocument, toString
-
-
-
-
Method Detail
-
startElement
public void startElement(java.lang.String namespaceURI, java.lang.String localName, java.lang.String qName, org.xml.sax.Attributes atts) throws org.xml.sax.SAXException
- Specified by:
startElement
in interfaceorg.xml.sax.ContentHandler
- Overrides:
startElement
in classContentHandlerDecorator
- Throws:
org.xml.sax.SAXException
-
endElement
public void endElement(java.lang.String namespaceURI, java.lang.String localName, java.lang.String qName) throws org.xml.sax.SAXException
- Specified by:
endElement
in interfaceorg.xml.sax.ContentHandler
- Overrides:
endElement
in classContentHandlerDecorator
- Throws:
org.xml.sax.SAXException
-
startPrefixMapping
public void startPrefixMapping(java.lang.String prefix, java.lang.String uri) throws org.xml.sax.SAXException
- Specified by:
startPrefixMapping
in interfaceorg.xml.sax.ContentHandler
- Overrides:
startPrefixMapping
in classContentHandlerDecorator
- Throws:
org.xml.sax.SAXException
-
resolveEntity
public org.xml.sax.InputSource resolveEntity(java.lang.String publicId, java.lang.String systemId) throws java.io.IOException, org.xml.sax.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 interfaceorg.xml.sax.EntityResolver
- Overrides:
resolveEntity
in classorg.xml.sax.helpers.DefaultHandler
- Throws:
java.io.IOException
org.xml.sax.SAXException
-
-