soapical.likeoldsax
Class FriendlyNamespaceSupport

java.lang.Object
  extended byorg.xml.sax.helpers.NamespaceSupport
      extended bysoapical.likeoldsax.FriendlyNamespaceSupport

public class FriendlyNamespaceSupport
extends org.xml.sax.helpers.NamespaceSupport

Further encapsulates the namespace logic than what is provided with SAX2's NamespaceSupport. This is useful for ContentHandlers which need to use the namespace information for something or another.

Version:
$Revision: 1.1.1.1 $
$Date: 2003/04/21 09:43:18 $
Author:
Eric Kow (kow at loria point fr)

Field Summary
 
Fields inherited from class org.xml.sax.helpers.NamespaceSupport
XMLNS
 
Constructor Summary
FriendlyNamespaceSupport()
           
 
Method Summary
 java.util.List declareNamespaces(org.xml.sax.Attributes atts)
          For all items in Attributes that have a prefix, declare that prefix's namespace into this namespace stack.
 java.lang.String declareNamespaces(java.lang.String nsURI, java.lang.String localName, java.lang.String qName)
          This is meant to be called from startElement.
 
Methods inherited from class org.xml.sax.helpers.NamespaceSupport
declarePrefix, getDeclaredPrefixes, getPrefix, getPrefixes, getPrefixes, getURI, popContext, processName, pushContext, reset
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FriendlyNamespaceSupport

public FriendlyNamespaceSupport()
Method Detail

declareNamespaces

public java.lang.String declareNamespaces(java.lang.String nsURI,
                                          java.lang.String localName,
                                          java.lang.String qName)
                                   throws org.xml.sax.SAXException
This is meant to be called from startElement. If qName is a prefixed name, we declare the namespace URI associated with that prefix; otherwise, we declare the namespace associated with the localName

Parameters:
nsURI - the namespace URI to associate with the qName prefix
qName - a qualified XML name; if you pass an unqualified name, we assume you are talking about the default namespace
Returns:
the prefix for the namespace we just declared
Throws:
org.xml.sax.SAXException

declareNamespaces

public java.util.List declareNamespaces(org.xml.sax.Attributes atts)
                                 throws org.xml.sax.SAXException
For all items in Attributes that have a prefix, declare that prefix's namespace into this namespace stack. Also, in case we are not using a namespace-aware parser, declare into the namespace stack all attributes which are not namespace declarations.

Returns:
a List of prefixes for the namespaces we declare
Throws:
org.xml.sax.SAXException - if there are any attributes which themselves are namespace declarations