Class XmlnsContentHandler
java.lang.Object
org.xml.sax.helpers.DefaultHandler
org.apache.jackrabbit.commons.xml.ProxyContentHandler
org.apache.jackrabbit.commons.xml.XmlnsContentHandler
- All Implemented Interfaces:
ContentHandler,DTDHandler,EntityResolver,ErrorHandler
Content handler proxy that adds explicit "xmlns" attributes for all
namespace mappings introduced through
startPrefixMapping(String, String) calls.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidstartElement(String namespaceURI, String localName, String qName, Attributes atts) Adds the recorded namespace mappings (if any) as "xmlns" attributes before passing the call on to the proxied content handler.voidstartPrefixMapping(String prefix, String uri) Records the namespace mapping and passes the call to the proxied content handler.Methods inherited from class org.apache.jackrabbit.commons.xml.ProxyContentHandler
characters, endDocument, endElement, endPrefixMapping, ignorableWhitespace, processingInstruction, setDocumentLocator, skippedEntity, startDocument, toStringMethods inherited from class org.xml.sax.helpers.DefaultHandler
error, fatalError, notationDecl, resolveEntity, unparsedEntityDecl, warningMethods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.xml.sax.ContentHandler
declaration
-
Constructor Details
-
XmlnsContentHandler
-
-
Method Details
-
startPrefixMapping
Records the namespace mapping and passes the call to the proxied content handler.- Specified by:
startPrefixMappingin interfaceContentHandler- Overrides:
startPrefixMappingin classProxyContentHandler- Parameters:
prefix- passed throughuri- passed through- Throws:
SAXException- if an error occurs
-
startElement
public void startElement(String namespaceURI, String localName, String qName, Attributes atts) throws SAXException Adds the recorded namespace mappings (if any) as "xmlns" attributes before passing the call on to the proxied content handler.- Specified by:
startElementin interfaceContentHandler- Overrides:
startElementin classProxyContentHandler- Parameters:
namespaceURI- passed throughlocalName- passed throughqName- passed throughatts- passed through- Throws:
SAXException- if an error occurs
-