org.apache.jackrabbit.commons.xml
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 through
startPrefixMapping(String, String) calls.
|
Method Summary |
void |
startElement(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. |
void |
startPrefixMapping(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.xml.sax.helpers.DefaultHandler |
error, fatalError, notationDecl, resolveEntity, unparsedEntityDecl, warning |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
XmlnsContentHandler
public XmlnsContentHandler(org.xml.sax.ContentHandler handler)
startPrefixMapping
public void startPrefixMapping(java.lang.String prefix,
java.lang.String uri)
throws org.xml.sax.SAXException
- Records the namespace mapping and passes the call to the proxied
content handler.
- Specified by:
startPrefixMapping in interface org.xml.sax.ContentHandler- Overrides:
startPrefixMapping in class ProxyContentHandler
- 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.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 interface org.xml.sax.ContentHandler- Overrides:
startElement in class ProxyContentHandler
- Parameters:
namespaceURI - passed throughlocalName - passed throughqName - passed throughatts - passed through
- Throws:
org.xml.sax.SAXException - if an error occurs
Copyright © 2004-2010 The Apache Software Foundation. All Rights Reserved.