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:
org.xml.sax.ContentHandler,org.xml.sax.DTDHandler,org.xml.sax.EntityResolver,org.xml.sax.ErrorHandler
public class XmlnsContentHandler extends ProxyContentHandler
Content handler proxy that adds explicit "xmlns" attributes for all namespace mappings introduced throughstartPrefixMapping(String, String)calls.
-
-
Constructor Summary
Constructors Constructor Description XmlnsContentHandler(org.xml.sax.ContentHandler handler)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidstartElement(java.lang.String namespaceURI, java.lang.String localName, java.lang.String qName, org.xml.sax.Attributes atts)Adds the recorded namespace mappings (if any) as "xmlns" attributes before passing the call on to the proxied content handler.voidstartPrefixMapping(java.lang.String prefix, java.lang.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
-
-
-
-
Method Detail
-
startPrefixMapping
public void startPrefixMapping(java.lang.String prefix, java.lang.String uri) throws org.xml.sax.SAXExceptionRecords the namespace mapping and passes the call to the proxied content handler.- Specified by:
startPrefixMappingin interfaceorg.xml.sax.ContentHandler- Overrides:
startPrefixMappingin classProxyContentHandler- Parameters:
prefix- passed throughuri- passed through- Throws:
org.xml.sax.SAXException- if an error occurs
-
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.SAXExceptionAdds the recorded namespace mappings (if any) as "xmlns" attributes before passing the call on to the proxied content handler.- Specified by:
startElementin interfaceorg.xml.sax.ContentHandler- Overrides:
startElementin classProxyContentHandler- Parameters:
namespaceURI- passed throughlocalName- passed throughqName- passed throughatts- passed through- Throws:
org.xml.sax.SAXException- if an error occurs
-
-