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
public class XmlnsContentHandler extends ProxyContentHandler
Content handler proxy that adds explicit "xmlns" attributes for all namespace mappings introduced throughstartPrefixMapping(String, String)
calls.
-
-
Field Summary
-
Fields inherited from class org.apache.jackrabbit.commons.xml.ProxyContentHandler
handler
-
-
Constructor Summary
Constructors Constructor Description XmlnsContentHandler(ContentHandler handler)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
startElement(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.void
startPrefixMapping(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, toString
-
Methods inherited from class org.xml.sax.helpers.DefaultHandler
error, fatalError, notationDecl, resolveEntity, unparsedEntityDecl, warning
-
-
-
-
Constructor Detail
-
XmlnsContentHandler
public XmlnsContentHandler(ContentHandler handler)
-
-
Method Detail
-
startPrefixMapping
public void startPrefixMapping(String prefix, String uri) throws SAXException
Records the namespace mapping and passes the call to the proxied content handler.- Specified by:
startPrefixMapping
in interfaceContentHandler
- Overrides:
startPrefixMapping
in 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:
startElement
in interfaceContentHandler
- Overrides:
startElement
in classProxyContentHandler
- Parameters:
namespaceURI
- passed throughlocalName
- passed throughqName
- passed throughatts
- passed through- Throws:
SAXException
- if an error occurs
-
-