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
Method Summary |
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.xml.sax.helpers.DefaultHandler |
error, fatalError, notationDecl, unparsedEntityDecl, warning |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
NSNormalizerContentHandler
public NSNormalizerContentHandler(org.xml.sax.ContentHandler handler)
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 interface org.xml.sax.ContentHandler
- Overrides:
startElement
in class ContentHandlerDecorator
- 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 interface org.xml.sax.ContentHandler
- Overrides:
endElement
in class ContentHandlerDecorator
- 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 interface org.xml.sax.ContentHandler
- Overrides:
startPrefixMapping
in class ContentHandlerDecorator
- 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 interface org.xml.sax.EntityResolver
- Overrides:
resolveEntity
in class org.xml.sax.helpers.DefaultHandler
- Throws:
java.io.IOException
org.xml.sax.SAXException
Copyright © 2010 The Apache Software Foundation. All Rights Reserved.