Class 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 Detail

      • NSNormalizerContentHandler

        public NSNormalizerContentHandler​(org.xml.sax.ContentHandler handler)
    • 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 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