donaldp 2002/11/12 15:31:37
Modified: xmlutil/src/java/org/apache/excalibur/xml/sax
DocumentHandlerAdapter.java
Log:
Remove unused variable
Revision Changes Path
1.6 +30 -30
jakarta-avalon-excalibur/xmlutil/src/java/org/apache/excalibur/xml/sax/DocumentHandlerAdapter.java
Index: DocumentHandlerAdapter.java
===================================================================
RCS file:
/home/cvs/jakarta-avalon-excalibur/xmlutil/src/java/org/apache/excalibur/xml/sax/DocumentHandlerAdapter.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- DocumentHandlerAdapter.java 16 Oct 2002 17:26:59 -0000 1.5
+++ DocumentHandlerAdapter.java 12 Nov 2002 23:31:37 -0000 1.6
@@ -23,7 +23,8 @@
* @author <a href="mailto:mirceatoma@;apache.org">Mircea Toma</a>
* @version CVS $Revision$ $Date$
*/
-public class DocumentHandlerAdapter implements ContentHandler
+public class DocumentHandlerAdapter
+ implements ContentHandler
{
private final static String XMLNS = "xmlns";
private final static String XMLNS_PREFIX = "xmlns:";
@@ -31,7 +32,7 @@
private final DocumentHandler m_documentHandler;
private final NamespaceSupport m_support = new NamespaceSupport();
private boolean m_contextPushed = false;
-
+
/**
* Create a new <code>ContentHandlerWrapper</code> instance.
*/
@@ -39,7 +40,7 @@
{
m_documentHandler = documentHandler;
}
-
+
/**
* Receive an object for locating the origin of SAX document events.
*/
@@ -47,7 +48,7 @@
{
m_documentHandler.setDocumentLocator( locator );
}
-
+
/**
* Receive notification of the beginning of a document.
*/
@@ -55,7 +56,7 @@
{
m_documentHandler.startDocument();
}
-
+
/**
* Receive notification of the end of a document.
*/
@@ -64,7 +65,7 @@
{
m_documentHandler.endDocument();
}
-
+
/**
* Begin the scope of a prefix-URI Namespace mapping.
*/
@@ -75,10 +76,10 @@
m_support.pushContext();
m_contextPushed = true;
}
-
+
m_support.declarePrefix( prefix, uri );
}
-
+
/**
* End the scope of a prefix-URI mapping.
*/
@@ -86,7 +87,7 @@
{
//do nothing
}
-
+
/**
* Receive notification of the beginning of an element.
*/
@@ -100,9 +101,9 @@
m_support.pushContext();
}
m_contextPushed = false;
-
+
final String name = getTagName(loc, raw, uri);
-
+
final AttributeListImpl attributeList = new AttributeListImpl();
for (int i = 0; i < a.getLength(); i++)
{
@@ -118,8 +119,8 @@
else
{
final String prefix = m_support.getPrefix(
attributeNamespaceURI );
- if (prefix == null)
- {
+ if (prefix == null)
+ {
throw new SAXException( "No attribute prefix for namespace
URI: " + attributeNamespaceURI );
}
attributeName = prefix + ':' + attributeLocalName;
@@ -127,12 +128,11 @@
}
attributeList.addAttribute( attributeName, a.getType( i ), a.getValue(
i ) );
}
-
+
final Enumeration e = m_support.getDeclaredPrefixes();
while( e.hasMoreElements() )
{
final String prefix = (String)e.nextElement();
- final String namespaceURI = m_support.getURI( prefix );
if ( prefix.length() == 0 )
{
attributeList.addAttribute( XMLNS, CDATA, uri );
@@ -142,10 +142,10 @@
attributeList.addAttribute( XMLNS_PREFIX + prefix, CDATA, uri );
}
}
-
+
m_documentHandler.startElement( name, attributeList );
}
-
+
/**
* Receive notification of the end of an element.
*/
@@ -153,11 +153,11 @@
final String loc,
final String raw ) throws SAXException
{
- final String name = getTagName( loc, raw, uri );
- m_documentHandler.endElement( name );
+ final String name = getTagName( loc, raw, uri );
+ m_documentHandler.endElement( name );
m_support.popContext();
}
-
+
/**
* Receive notification of character data.
*/
@@ -167,7 +167,7 @@
{
m_documentHandler.characters( ch, start, len );
}
-
+
/**
* Receive notification of ignorable whitespace in element content.
*/
@@ -177,7 +177,7 @@
{
m_documentHandler.ignorableWhitespace( ch, start, len );
}
-
+
/**
* Receive notification of a processing instruction.
*/
@@ -186,7 +186,7 @@
{
m_documentHandler.processingInstruction( target, data );
}
-
+
/**
* Receive notification of a skipped entity.
*
@@ -197,20 +197,20 @@
{
//do nothing
}
-
+
private String getTagName( final String loc, final String raw, final String uri
) throws SAXException
{
- if (raw != null && raw.length() > 0)
+ if (raw != null && raw.length() > 0)
{
return raw;
}
else
{
- final String prefix = getTagPrefix( uri );
+ final String prefix = getTagPrefix( uri );
return ( ( prefix.length() == 0 ) ? "" : ( prefix + ':' ) ) + loc;
}
}
-
+
private String getTagPrefix( final String uri ) throws SAXException
{
if ( m_support.getPrefix( uri ) == null )
@@ -222,7 +222,7 @@
else
{
final String defaultURI = m_support.getURI( "" );
- if ( ( defaultURI != null ) && defaultURI.equals( uri ) )
+ if ( ( defaultURI != null ) && defaultURI.equals( uri ) )
{
return ""; // default namespace
}
@@ -234,6 +234,6 @@
}
else {
return m_support.getPrefix( uri );
- }
+ }
}
}
--
To unsubscribe, e-mail: <mailto:avalon-cvs-unsubscribe@;jakarta.apache.org>
For additional commands, e-mail: <mailto:avalon-cvs-help@;jakarta.apache.org>