org.apache.jackrabbit.commons.xml
Class XmlnsContentHandler

java.lang.Object
  extended by org.xml.sax.helpers.DefaultHandler
      extended by org.apache.jackrabbit.commons.xml.ProxyContentHandler
          extended by 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 through startPrefixMapping(String, String) calls.


Field Summary
 
Fields inherited from class org.apache.jackrabbit.commons.xml.ProxyContentHandler
handler
 
Constructor Summary
XmlnsContentHandler(ContentHandler handler)
           
 
Method Summary
 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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

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 interface ContentHandler
Overrides:
startPrefixMapping in class ProxyContentHandler
Parameters:
prefix - passed through
uri - 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 interface ContentHandler
Overrides:
startElement in class ProxyContentHandler
Parameters:
namespaceURI - passed through
localName - passed through
qName - passed through
atts - passed through
Throws:
SAXException - if an error occurs


Copyright © 2004-2010 The Apache Software Foundation. All Rights Reserved.