Blame SOURCES/0002-Drop-the-dependencies-on-kxml-xpp3.patch

ecefdb
From 73145d799492ba1ae5553cd92a5f13af07896107 Mon Sep 17 00:00:00 2001
ecefdb
From: Mat Booth <mat.booth@redhat.com>
ecefdb
Date: Wed, 22 Jan 2020 18:34:26 +0000
ecefdb
Subject: [PATCH 2/2] Drop the dependencies on kxml/xpp3
ecefdb
ecefdb
Instead we use the SAX parser implementation from the JDK
ecefdb
ecefdb
Signed-off-by: Mat Booth <mat.booth@redhat.com>
ecefdb
---
ecefdb
 bnd.bnd                                       |   2 -
ecefdb
 pom.xml                                       |   6 -
ecefdb
 .../scr/impl/BundleComponentActivator.java    |  13 +-
ecefdb
 .../scr/impl/parser/KXml2SAXHandler.java      |  69 ------
ecefdb
 .../felix/scr/impl/parser/KXml2SAXParser.java | 177 --------------
ecefdb
 .../felix/scr/impl/parser/ParseException.java |  29 ---
ecefdb
 .../apache/felix/scr/impl/xml/XmlHandler.java | 228 +++++++-----------
ecefdb
 7 files changed, 99 insertions(+), 425 deletions(-)
ecefdb
 delete mode 100644 src/main/java/org/apache/felix/scr/impl/parser/KXml2SAXHandler.java
ecefdb
 delete mode 100644 src/main/java/org/apache/felix/scr/impl/parser/KXml2SAXParser.java
ecefdb
 delete mode 100644 src/main/java/org/apache/felix/scr/impl/parser/ParseException.java
ecefdb
ecefdb
diff --git a/bnd.bnd b/bnd.bnd
ecefdb
index ae3fadb..299eb73 100644
ecefdb
--- a/bnd.bnd
ecefdb
+++ b/bnd.bnd
ecefdb
@@ -47,5 +47,3 @@ DynamicImport-Package: \
ecefdb
  org.osgi.service.cm;version="[1.6,2)", \
ecefdb
  org.osgi.service.log;version="[1.3,2)", \
ecefdb
  org.osgi.service.metatype;version="[1.1,2)"
ecefdb
-
ecefdb
-Embed-Dependency: kxml2;inline=org/kxml2/io/KXmlParser.class|org/xmlpull/v1/XmlPull**
ecefdb
diff --git a/pom.xml b/pom.xml
ecefdb
index 682b07a..16819c7 100644
ecefdb
--- a/pom.xml
ecefdb
+++ b/pom.xml
ecefdb
@@ -129,12 +129,6 @@
ecefdb
             <version>1.0.0</version>
ecefdb
             <scope>provided</scope>
ecefdb
         </dependency>
ecefdb
-        <dependency>
ecefdb
-            <groupId>net.sf.kxml</groupId>
ecefdb
-            <artifactId>kxml2</artifactId>
ecefdb
-            <version>2.2.2</version>
ecefdb
-            <scope>provided</scope>
ecefdb
-        </dependency>
ecefdb
 
ecefdb
         
ecefdb
         <dependency>
ecefdb
diff --git a/src/main/java/org/apache/felix/scr/impl/BundleComponentActivator.java b/src/main/java/org/apache/felix/scr/impl/BundleComponentActivator.java
ecefdb
index 4a8c94a..9a5259f 100644
ecefdb
--- a/src/main/java/org/apache/felix/scr/impl/BundleComponentActivator.java
ecefdb
+++ b/src/main/java/org/apache/felix/scr/impl/BundleComponentActivator.java
ecefdb
@@ -18,10 +18,8 @@
ecefdb
  */
ecefdb
 package org.apache.felix.scr.impl;
ecefdb
 
ecefdb
-import java.io.BufferedReader;
ecefdb
 import java.io.IOException;
ecefdb
 import java.io.InputStream;
ecefdb
-import java.io.InputStreamReader;
ecefdb
 import java.net.URL;
ecefdb
 import java.util.ArrayList;
ecefdb
 import java.util.Collections;
ecefdb
@@ -34,6 +32,9 @@ import java.util.concurrent.CountDownLatch;
ecefdb
 import java.util.concurrent.TimeUnit;
ecefdb
 import java.util.concurrent.atomic.AtomicBoolean;
ecefdb
 
ecefdb
+import javax.xml.parsers.SAXParser;
ecefdb
+import javax.xml.parsers.SAXParserFactory;
ecefdb
+
ecefdb
 import org.apache.felix.scr.impl.helper.ConfigAdminTracker;
ecefdb
 import org.apache.felix.scr.impl.logger.BundleLogger;
ecefdb
 import org.apache.felix.scr.impl.logger.ComponentLogger;
ecefdb
@@ -47,7 +48,6 @@ import org.apache.felix.scr.impl.manager.ExtendedServiceListener;
ecefdb
 import org.apache.felix.scr.impl.manager.RegionConfigurationSupport;
ecefdb
 import org.apache.felix.scr.impl.manager.ScrConfiguration;
ecefdb
 import org.apache.felix.scr.impl.metadata.ComponentMetadata;
ecefdb
-import org.apache.felix.scr.impl.parser.KXml2SAXParser;
ecefdb
 import org.apache.felix.scr.impl.xml.XmlHandler;
ecefdb
 import org.osgi.framework.Bundle;
ecefdb
 import org.osgi.framework.BundleContext;
ecefdb
@@ -420,12 +420,13 @@ public class BundleComponentActivator implements ComponentActivator
ecefdb
         {
ecefdb
             stream = descriptorURL.openStream();
ecefdb
 
ecefdb
-            BufferedReader in = new BufferedReader( new InputStreamReader( stream, "UTF-8" ) );
ecefdb
             XmlHandler handler = new XmlHandler( m_bundle, this.logger, getConfiguration().isFactoryEnabled(),
ecefdb
                 getConfiguration().keepInstances() );
ecefdb
-            final KXml2SAXParser parser = new KXml2SAXParser( in );
ecefdb
+            final SAXParserFactory factory = SAXParserFactory.newInstance();
ecefdb
+            factory.setNamespaceAware(true);
ecefdb
+            final SAXParser parser = factory.newSAXParser();
ecefdb
 
ecefdb
-            parser.parseXML( handler );
ecefdb
+            parser.parse( stream, handler );
ecefdb
 
ecefdb
             // 112.4.2 Component descriptors may contain a single, root component element
ecefdb
             // or one or more component elements embedded in a larger document
ecefdb
diff --git a/src/main/java/org/apache/felix/scr/impl/parser/KXml2SAXHandler.java b/src/main/java/org/apache/felix/scr/impl/parser/KXml2SAXHandler.java
ecefdb
deleted file mode 100644
ecefdb
index b6e4c36..0000000
ecefdb
--- a/src/main/java/org/apache/felix/scr/impl/parser/KXml2SAXHandler.java
ecefdb
+++ /dev/null
ecefdb
@@ -1,69 +0,0 @@
ecefdb
-/*
ecefdb
- * Licensed to the Apache Software Foundation (ASF) under one
ecefdb
- * or more contributor license agreements.  See the NOTICE file
ecefdb
- * distributed with this work for additional information
ecefdb
- * regarding copyright ownership.  The ASF licenses this file
ecefdb
- * to you under the Apache License, Version 2.0 (the
ecefdb
- * "License"); you may not use this file except in compliance
ecefdb
- * with the License.  You may obtain a copy of the License at
ecefdb
- *
ecefdb
- *   http://www.apache.org/licenses/LICENSE-2.0
ecefdb
- *
ecefdb
- * Unless required by applicable law or agreed to in writing,
ecefdb
- * software distributed under the License is distributed on an
ecefdb
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
ecefdb
- * KIND, either express or implied.  See the License for the
ecefdb
- * specific language governing permissions and limitations
ecefdb
- * under the License.
ecefdb
- */
ecefdb
-package org.apache.felix.scr.impl.parser;
ecefdb
-
ecefdb
-import org.apache.felix.scr.impl.parser.KXml2SAXParser.Attributes;
ecefdb
-
ecefdb
-/**
ecefdb
- * Interface for a SAX like handler with kXML
ecefdb
- */
ecefdb
-public interface KXml2SAXHandler {
ecefdb
-
ecefdb
-   /**
ecefdb
-	* Method called when parsing text
ecefdb
-	*
ecefdb
-	* @param   text
ecefdb
-	* @exception   ParseException
ecefdb
-	*/
ecefdb
-   void characters(String text) throws ParseException;
ecefdb
-
ecefdb
-   /**
ecefdb
-	* Method called when a tag opens
ecefdb
-	*
ecefdb
-	* @param   uri
ecefdb
-	* @param   localName
ecefdb
-	* @param   attributes
ecefdb
-	* @exception   ParseException
ecefdb
-	*/
ecefdb
-	void startElement(
ecefdb
-		String uri,
ecefdb
-		String localName,
ecefdb
-		Attributes attributes)
ecefdb
-		throws ParseException;
ecefdb
-
ecefdb
-   /**
ecefdb
-	* Method called when a tag closes
ecefdb
-	*
ecefdb
-	* @param   uri
ecefdb
-	* @param   localName
ecefdb
-	* @exception   ParseException
ecefdb
-	*/
ecefdb
-    void endElement(
ecefdb
-		String uri,
ecefdb
-		String localName)
ecefdb
-		throws ParseException;
ecefdb
-
ecefdb
-    void processingInstruction(String target,
ecefdb
-									  String data)
ecefdb
-							   throws Exception;
ecefdb
-
ecefdb
-	void setLineNumber(int lineNumber);
ecefdb
-
ecefdb
-	void setColumnNumber(int columnNumber);
ecefdb
-}
ecefdb
diff --git a/src/main/java/org/apache/felix/scr/impl/parser/KXml2SAXParser.java b/src/main/java/org/apache/felix/scr/impl/parser/KXml2SAXParser.java
ecefdb
deleted file mode 100644
ecefdb
index 39717c8..0000000
ecefdb
--- a/src/main/java/org/apache/felix/scr/impl/parser/KXml2SAXParser.java
ecefdb
+++ /dev/null
ecefdb
@@ -1,177 +0,0 @@
ecefdb
-/*
ecefdb
- * Licensed to the Apache Software Foundation (ASF) under one
ecefdb
- * or more contributor license agreements.  See the NOTICE file
ecefdb
- * distributed with this work for additional information
ecefdb
- * regarding copyright ownership.  The ASF licenses this file
ecefdb
- * to you under the Apache License, Version 2.0 (the
ecefdb
- * "License"); you may not use this file except in compliance
ecefdb
- * with the License.  You may obtain a copy of the License at
ecefdb
- *
ecefdb
- *   http://www.apache.org/licenses/LICENSE-2.0
ecefdb
- *
ecefdb
- * Unless required by applicable law or agreed to in writing,
ecefdb
- * software distributed under the License is distributed on an
ecefdb
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
ecefdb
- * KIND, either express or implied.  See the License for the
ecefdb
- * specific language governing permissions and limitations
ecefdb
- * under the License.
ecefdb
- */
ecefdb
-package org.apache.felix.scr.impl.parser;
ecefdb
-
ecefdb
-
ecefdb
-import java.io.Reader;
ecefdb
-import java.util.Stack;
ecefdb
-
ecefdb
-import org.kxml2.io.KXmlParser;
ecefdb
-import org.xmlpull.v1.XmlPullParser;
ecefdb
-import org.xmlpull.v1.XmlPullParserException;
ecefdb
-
ecefdb
-
ecefdb
-/**
ecefdb
- * The KXml2SAXParser extends the XmlParser from kxml. This is a very
ecefdb
- * simple parser that does not take into account the DTD
ecefdb
- *
ecefdb
- */
ecefdb
-public class KXml2SAXParser extends KXmlParser
ecefdb
-{
ecefdb
-
ecefdb
-    /**
ecefdb
-     * The constructor for a parser, it receives a java.io.Reader.
ecefdb
-     *
ecefdb
-     * @param   reader  The reader
ecefdb
-     * @throws XmlPullParserException
ecefdb
-     */
ecefdb
-    public KXml2SAXParser( Reader reader ) throws XmlPullParserException
ecefdb
-    {
ecefdb
-        super();
ecefdb
-        setInput( reader );
ecefdb
-        setFeature( FEATURE_PROCESS_NAMESPACES, true );
ecefdb
-    }
ecefdb
-
ecefdb
-
ecefdb
-    /**
ecefdb
-     * Parser from the reader provided in the constructor, and call
ecefdb
-     * the startElement and endElement in a KxmlHandler
ecefdb
-     *
ecefdb
-     * @param   handler  The handler
ecefdb
-     * @exception   Exception thrown by the superclass
ecefdb
-     */
ecefdb
-    public void parseXML( KXml2SAXHandler handler ) throws Exception
ecefdb
-    {
ecefdb
-
ecefdb
-        final Stack<XmlElement> openElements = new Stack<XmlElement>();
ecefdb
-        XmlElement currentElement = null;
ecefdb
-        final Attributes attributes = new Attributes();
ecefdb
-
ecefdb
-        while ( next() != XmlPullParser.END_DOCUMENT )
ecefdb
-        {
ecefdb
-            handler.setLineNumber( getLineNumber() );
ecefdb
-            handler.setColumnNumber( getColumnNumber() );
ecefdb
-
ecefdb
-            if ( getEventType() == XmlPullParser.START_TAG )
ecefdb
-            {
ecefdb
-                currentElement = new XmlElement( getNamespace(), getName(), getLineNumber(), getColumnNumber() );
ecefdb
-                openElements.push( currentElement );
ecefdb
-
ecefdb
-                handler.startElement( getNamespace(), getName(), attributes );
ecefdb
-            }
ecefdb
-            else if ( getEventType() == XmlPullParser.END_TAG )
ecefdb
-            {
ecefdb
-                ensureMatchingCurrentElement(currentElement);
ecefdb
-                openElements.pop();
ecefdb
-                currentElement = openElements.isEmpty() ? null : ( XmlElement ) openElements.peek();
ecefdb
-
ecefdb
-                handler.endElement( getNamespace(), getName() );
ecefdb
-            }
ecefdb
-            else if ( getEventType() == XmlPullParser.TEXT )
ecefdb
-            {
ecefdb
-                String text = getText();
ecefdb
-                handler.characters( text );
ecefdb
-            }
ecefdb
-            else if ( getEventType() == XmlPullParser.PROCESSING_INSTRUCTION )
ecefdb
-            {
ecefdb
-                // TODO extract the target from the evt.getText()
ecefdb
-                handler.processingInstruction( null, getText() );
ecefdb
-            }
ecefdb
-            else
ecefdb
-            {
ecefdb
-                // do nothing
ecefdb
-            }
ecefdb
-        }
ecefdb
-
ecefdb
-        if ( !openElements.isEmpty() )
ecefdb
-        {
ecefdb
-            throw new ParseException( "Unclosed elements found: " + openElements, null );
ecefdb
-        }
ecefdb
-    }
ecefdb
-
ecefdb
-
ecefdb
-    private void ensureMatchingCurrentElement( final XmlElement currentElement ) throws Exception
ecefdb
-    {
ecefdb
-        if ( currentElement == null )
ecefdb
-        {
ecefdb
-            throw new ParseException( "Unexpected closing element "
ecefdb
-                    + new XmlElement( getNamespace(), getName(), getLineNumber(), getColumnNumber() ), null );
ecefdb
-        }
ecefdb
-
ecefdb
-        if ( !currentElement.match( getNamespace(), getName() ) )
ecefdb
-        {
ecefdb
-            throw new ParseException( "Unexpected closing element "
ecefdb
-                    + new XmlElement( getNamespace(), getName(), getLineNumber(), getColumnNumber() )
ecefdb
-                    + ": Does not match opening element " + currentElement, null );
ecefdb
-        }
ecefdb
-    }
ecefdb
-
ecefdb
-    private static class XmlElement
ecefdb
-    {
ecefdb
-
ecefdb
-        final String namespaceUri;
ecefdb
-        final String name;
ecefdb
-        final int line;
ecefdb
-        final int col;
ecefdb
-
ecefdb
-
ecefdb
-        XmlElement( final String namespaceUri, final String name, final int line, final int col )
ecefdb
-        {
ecefdb
-            this.namespaceUri = namespaceUri;
ecefdb
-            this.name = name;
ecefdb
-            this.line = line;
ecefdb
-            this.col = col;
ecefdb
-        }
ecefdb
-
ecefdb
-
ecefdb
-        boolean match( final String namespaceUri, final String name )
ecefdb
-        {
ecefdb
-            return namespaceUri.equals( this.namespaceUri ) && name.equals( this.name );
ecefdb
-        }
ecefdb
-
ecefdb
-        @Override
ecefdb
-        public String toString()
ecefdb
-        {
ecefdb
-            return name + "@" + line + ":" + col;
ecefdb
-        }
ecefdb
-    }
ecefdb
-
ecefdb
-    public class Attributes {
ecefdb
-
ecefdb
-        public String getAttribute(String name) {
ecefdb
-            return getAttributeValue("", name);
ecefdb
-        }
ecefdb
-
ecefdb
-        public String getAttribute(String uri, String name) {
ecefdb
-            return getAttributeValue(uri, name);
ecefdb
-        }
ecefdb
-
ecefdb
-        public boolean getBoolAttribute(String name, boolean defaultValue) {
ecefdb
-            return getBoolAttribute("", name, defaultValue);
ecefdb
-        }
ecefdb
-
ecefdb
-        public boolean getBoolAttribute(String uri, String name, boolean defaultValue) {
ecefdb
-            final String val = getAttribute(uri, name);
ecefdb
-            if ( val != null ) {
ecefdb
-                return "true".equals(val);
ecefdb
-            }
ecefdb
-            return defaultValue;
ecefdb
-        }
ecefdb
-    }
ecefdb
-}
ecefdb
diff --git a/src/main/java/org/apache/felix/scr/impl/parser/ParseException.java b/src/main/java/org/apache/felix/scr/impl/parser/ParseException.java
ecefdb
deleted file mode 100644
ecefdb
index c1bf6f2..0000000
ecefdb
--- a/src/main/java/org/apache/felix/scr/impl/parser/ParseException.java
ecefdb
+++ /dev/null
ecefdb
@@ -1,29 +0,0 @@
ecefdb
-/* 
ecefdb
- * Licensed to the Apache Software Foundation (ASF) under one
ecefdb
- * or more contributor license agreements.  See the NOTICE file
ecefdb
- * distributed with this work for additional information
ecefdb
- * regarding copyright ownership.  The ASF licenses this file
ecefdb
- * to you under the Apache License, Version 2.0 (the
ecefdb
- * "License"); you may not use this file except in compliance
ecefdb
- * with the License.  You may obtain a copy of the License at
ecefdb
- *
ecefdb
- *   http://www.apache.org/licenses/LICENSE-2.0
ecefdb
- *
ecefdb
- * Unless required by applicable law or agreed to in writing,
ecefdb
- * software distributed under the License is distributed on an
ecefdb
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
ecefdb
- * KIND, either express or implied.  See the License for the
ecefdb
- * specific language governing permissions and limitations
ecefdb
- * under the License.
ecefdb
- */
ecefdb
-package org.apache.felix.scr.impl.parser;
ecefdb
-
ecefdb
-public class ParseException extends Exception
ecefdb
-{
ecefdb
-	private static final long serialVersionUID = 7476908955452692098L;
ecefdb
-
ecefdb
-	public ParseException(String msg, Exception originalException) {
ecefdb
-        super(msg, originalException);
ecefdb
-    }
ecefdb
-    
ecefdb
-}
ecefdb
diff --git a/src/main/java/org/apache/felix/scr/impl/xml/XmlHandler.java b/src/main/java/org/apache/felix/scr/impl/xml/XmlHandler.java
ecefdb
index aa7acf2..eb758ce 100644
ecefdb
--- a/src/main/java/org/apache/felix/scr/impl/xml/XmlHandler.java
ecefdb
+++ b/src/main/java/org/apache/felix/scr/impl/xml/XmlHandler.java
ecefdb
@@ -32,16 +32,16 @@ import org.apache.felix.scr.impl.metadata.DSVersion;
ecefdb
 import org.apache.felix.scr.impl.metadata.PropertyMetadata;
ecefdb
 import org.apache.felix.scr.impl.metadata.ReferenceMetadata;
ecefdb
 import org.apache.felix.scr.impl.metadata.ServiceMetadata;
ecefdb
-import org.apache.felix.scr.impl.parser.KXml2SAXHandler;
ecefdb
-import org.apache.felix.scr.impl.parser.KXml2SAXParser.Attributes;
ecefdb
-import org.apache.felix.scr.impl.parser.ParseException;
ecefdb
 import org.osgi.framework.Bundle;
ecefdb
 import org.osgi.service.log.LogService;
ecefdb
+import org.xml.sax.Attributes;
ecefdb
+import org.xml.sax.SAXException;
ecefdb
+import org.xml.sax.helpers.DefaultHandler;
ecefdb
 
ecefdb
 /**
ecefdb
  * XML Parser for the component XML
ecefdb
  */
ecefdb
-public class XmlHandler implements KXml2SAXHandler
ecefdb
+public class XmlHandler extends DefaultHandler
ecefdb
 {
ecefdb
     // the bundle containing the XML resource being parsed
ecefdb
     private final Bundle m_bundle;
ecefdb
@@ -68,6 +68,8 @@ public class XmlHandler implements KXml2SAXHandler
ecefdb
     // PropertyMetaData whose value attribute is missing, hence has element data
ecefdb
     private PropertyMetadata m_pendingFactoryProperty;
ecefdb
 
ecefdb
+    private StringBuilder propertyBuilder;
ecefdb
+
ecefdb
     /** Flag for detecting the first element. */
ecefdb
     protected boolean firstElement = true;
ecefdb
 
ecefdb
@@ -99,16 +101,8 @@ public class XmlHandler implements KXml2SAXHandler
ecefdb
     }
ecefdb
 
ecefdb
 
ecefdb
-    /**
ecefdb
-     * Method called when a tag opens
ecefdb
-     *
ecefdb
-     * @param   uri
ecefdb
-     * @param   localName
ecefdb
-     * @param   attributes
ecefdb
-     * @exception   ParseException
ecefdb
-     **/
ecefdb
     @Override
ecefdb
-    public void startElement( String uri, String localName, Attributes attributes ) throws ParseException
ecefdb
+    public void startElement( String uri, String localName, String qName, Attributes attributes ) throws SAXException
ecefdb
     {
ecefdb
         // according to the spec, the elements should have the namespace,
ecefdb
         // except when the root element is the "component" element
ecefdb
@@ -152,77 +146,77 @@ public class XmlHandler implements KXml2SAXHandler
ecefdb
                     m_currentComponent = new ComponentMetadata( namespaceCode );
ecefdb
 
ecefdb
                     // name attribute is optional (since DS 1.1)
ecefdb
-                    if ( attributes.getAttribute( XmlConstants.ATTR_NAME ) != null )
ecefdb
+                    if ( attributes.getValue( XmlConstants.NAMESPACE_URI_EMPTY, XmlConstants.ATTR_NAME ) != null )
ecefdb
                     {
ecefdb
-                        m_currentComponent.setName( attributes.getAttribute( XmlConstants.ATTR_NAME ) );
ecefdb
+                        m_currentComponent.setName( attributes.getValue( XmlConstants.NAMESPACE_URI_EMPTY, XmlConstants.ATTR_NAME ) );
ecefdb
                     }
ecefdb
 
ecefdb
                     // enabled attribute is optional
ecefdb
-                    if ( attributes.getAttribute( "enabled" ) != null )
ecefdb
+                    if ( attributes.getValue( XmlConstants.NAMESPACE_URI_EMPTY, "enabled" ) != null )
ecefdb
                     {
ecefdb
-                        m_currentComponent.setEnabled( attributes.getAttribute( "enabled" ).equals( "true" ) );
ecefdb
+                        m_currentComponent.setEnabled( attributes.getValue( XmlConstants.NAMESPACE_URI_EMPTY, "enabled" ).equals( "true" ) );
ecefdb
                     }
ecefdb
 
ecefdb
                     // immediate attribute is optional
ecefdb
-                    if ( attributes.getAttribute( "immediate" ) != null )
ecefdb
+                    if ( attributes.getValue( XmlConstants.NAMESPACE_URI_EMPTY, "immediate" ) != null )
ecefdb
                     {
ecefdb
-                        m_currentComponent.setImmediate( attributes.getAttribute( "immediate" ).equals( "true" ) );
ecefdb
+                        m_currentComponent.setImmediate( attributes.getValue( XmlConstants.NAMESPACE_URI_EMPTY, "immediate" ).equals( "true" ) );
ecefdb
                     }
ecefdb
 
ecefdb
                     // factory attribute is optional
ecefdb
-                    if ( attributes.getAttribute( "factory" ) != null )
ecefdb
+                    if ( attributes.getValue( XmlConstants.NAMESPACE_URI_EMPTY, "factory" ) != null )
ecefdb
                     {
ecefdb
-                        m_currentComponent.setFactoryIdentifier( attributes.getAttribute( "factory" ) );
ecefdb
+                        m_currentComponent.setFactoryIdentifier( attributes.getValue( XmlConstants.NAMESPACE_URI_EMPTY, "factory" ) );
ecefdb
                     }
ecefdb
 
ecefdb
                     // configuration-policy is optional (since DS 1.1)
ecefdb
-                    if ( attributes.getAttribute( "configuration-policy" ) != null )
ecefdb
+                    if ( attributes.getValue( XmlConstants.NAMESPACE_URI_EMPTY, "configuration-policy" ) != null )
ecefdb
                     {
ecefdb
-                        m_currentComponent.setConfigurationPolicy( attributes.getAttribute( "configuration-policy" ) );
ecefdb
+                        m_currentComponent.setConfigurationPolicy( attributes.getValue( XmlConstants.NAMESPACE_URI_EMPTY, "configuration-policy" ) );
ecefdb
                     }
ecefdb
 
ecefdb
                     // activate attribute is optional (since DS 1.1)
ecefdb
-                    if ( attributes.getAttribute( "activate" ) != null )
ecefdb
+                    if ( attributes.getValue( XmlConstants.NAMESPACE_URI_EMPTY, "activate" ) != null )
ecefdb
                     {
ecefdb
-                        m_currentComponent.setActivate( attributes.getAttribute( "activate" ) );
ecefdb
+                        m_currentComponent.setActivate( attributes.getValue( XmlConstants.NAMESPACE_URI_EMPTY, "activate" ) );
ecefdb
                     }
ecefdb
 
ecefdb
                     // deactivate attribute is optional (since DS 1.1)
ecefdb
-                    if ( attributes.getAttribute( "deactivate" ) != null )
ecefdb
+                    if ( attributes.getValue( XmlConstants.NAMESPACE_URI_EMPTY, "deactivate" ) != null )
ecefdb
                     {
ecefdb
-                        m_currentComponent.setDeactivate( attributes.getAttribute( "deactivate" ) );
ecefdb
+                        m_currentComponent.setDeactivate( attributes.getValue( XmlConstants.NAMESPACE_URI_EMPTY, "deactivate" ) );
ecefdb
                     }
ecefdb
 
ecefdb
                     // modified attribute is optional (since DS 1.1)
ecefdb
-                    if ( attributes.getAttribute( "modified" ) != null )
ecefdb
+                    if ( attributes.getValue( XmlConstants.NAMESPACE_URI_EMPTY, "modified" ) != null )
ecefdb
                     {
ecefdb
-                        m_currentComponent.setModified( attributes.getAttribute( "modified" ) );
ecefdb
+                        m_currentComponent.setModified( attributes.getValue( XmlConstants.NAMESPACE_URI_EMPTY, "modified" ) );
ecefdb
                     }
ecefdb
 
ecefdb
                     // configuration-pid attribute is optional (since DS 1.2)
ecefdb
-                    String configurationPidString = attributes.getAttribute( "configuration-pid" );
ecefdb
+                    String configurationPidString = attributes.getValue( XmlConstants.NAMESPACE_URI_EMPTY, "configuration-pid" );
ecefdb
                     if (configurationPidString != null)
ecefdb
                     {
ecefdb
                         String[] configurationPid = configurationPidString.split( " " );
ecefdb
                         m_currentComponent.setConfigurationPid( configurationPid );
ecefdb
                     }
ecefdb
 
ecefdb
-                    m_currentComponent.setConfigurableServiceProperties("true".equals(attributes.getAttribute(XmlConstants.NAMESPACE_URI_1_0_FELIX_EXTENSIONS, XmlConstants.ATTR_CONFIGURABLE_SERVICE_PROPERTIES)));
ecefdb
-                    m_currentComponent.setPersistentFactoryComponent("true".equals(attributes.getAttribute(XmlConstants.NAMESPACE_URI_1_0_FELIX_EXTENSIONS, XmlConstants.ATTR_PERSISTENT_FACTORY_COMPONENT)));
ecefdb
-                    m_currentComponent.setDeleteCallsModify("true".equals(attributes.getAttribute(XmlConstants.NAMESPACE_URI_1_0_FELIX_EXTENSIONS, XmlConstants.ATTR_DELETE_CALLS_MODIFY)));
ecefdb
-                    if ( attributes.getAttribute(XmlConstants.NAMESPACE_URI_1_0_FELIX_EXTENSIONS, XmlConstants.ATTR_OBSOLETE_FACTORY_COMPONENT_FACTORY) != null)
ecefdb
+                    m_currentComponent.setConfigurableServiceProperties("true".equals(attributes.getValue(XmlConstants.NAMESPACE_URI_1_0_FELIX_EXTENSIONS, XmlConstants.ATTR_CONFIGURABLE_SERVICE_PROPERTIES)));
ecefdb
+                    m_currentComponent.setPersistentFactoryComponent("true".equals(attributes.getValue(XmlConstants.NAMESPACE_URI_1_0_FELIX_EXTENSIONS, XmlConstants.ATTR_PERSISTENT_FACTORY_COMPONENT)));
ecefdb
+                    m_currentComponent.setDeleteCallsModify("true".equals(attributes.getValue(XmlConstants.NAMESPACE_URI_1_0_FELIX_EXTENSIONS, XmlConstants.ATTR_DELETE_CALLS_MODIFY)));
ecefdb
+                    if ( attributes.getValue(XmlConstants.NAMESPACE_URI_1_0_FELIX_EXTENSIONS, XmlConstants.ATTR_OBSOLETE_FACTORY_COMPONENT_FACTORY) != null)
ecefdb
                     {
ecefdb
-                        m_currentComponent.setObsoleteFactoryComponentFactory("true".equals(attributes.getAttribute(XmlConstants.NAMESPACE_URI_1_0_FELIX_EXTENSIONS, XmlConstants.ATTR_OBSOLETE_FACTORY_COMPONENT_FACTORY)));
ecefdb
+                        m_currentComponent.setObsoleteFactoryComponentFactory("true".equals(attributes.getValue(XmlConstants.NAMESPACE_URI_1_0_FELIX_EXTENSIONS, XmlConstants.ATTR_OBSOLETE_FACTORY_COMPONENT_FACTORY)));
ecefdb
                     }
ecefdb
                     else if ( !namespaceCode.isDS13() )
ecefdb
                     {
ecefdb
                         m_currentComponent.setObsoleteFactoryComponentFactory(m_globalObsoleteFactoryComponentFactory);
ecefdb
                     }
ecefdb
-                    m_currentComponent.setConfigureWithInterfaces("true".equals(attributes.getAttribute(XmlConstants.NAMESPACE_URI_1_0_FELIX_EXTENSIONS, XmlConstants.ATTR_CONFIGURE_WITH_INTERFACES)));
ecefdb
-                    m_currentComponent.setDelayedKeepInstances(m_globalDelayedKeepInstances || "true".equals(attributes.getAttribute(XmlConstants.NAMESPACE_URI_1_0_FELIX_EXTENSIONS, XmlConstants.ATTR_DELAYED_KEEP_INSTANCES)));
ecefdb
+                    m_currentComponent.setConfigureWithInterfaces("true".equals(attributes.getValue(XmlConstants.NAMESPACE_URI_1_0_FELIX_EXTENSIONS, XmlConstants.ATTR_CONFIGURE_WITH_INTERFACES)));
ecefdb
+                    m_currentComponent.setDelayedKeepInstances(m_globalDelayedKeepInstances || "true".equals(attributes.getValue(XmlConstants.NAMESPACE_URI_1_0_FELIX_EXTENSIONS, XmlConstants.ATTR_DELAYED_KEEP_INSTANCES)));
ecefdb
 
ecefdb
                     // activation-fields is optional (since DS 1.4)
ecefdb
-                    String activationFields = attributes.getAttribute( XmlConstants.ATTR_ACTIVATION_FIELDS );
ecefdb
+                    String activationFields = attributes.getValue( XmlConstants.NAMESPACE_URI_EMPTY, XmlConstants.ATTR_ACTIVATION_FIELDS );
ecefdb
                     if ( activationFields != null )
ecefdb
                     {
ecefdb
                         final String[] fields = activationFields.split(" ");
ecefdb
@@ -230,7 +224,7 @@ public class XmlHandler implements KXml2SAXHandler
ecefdb
                     }
ecefdb
 
ecefdb
                     // init is optional (since DS 1.4)
ecefdb
-                    String init = attributes.getAttribute( XmlConstants.ATTR_INIT );
ecefdb
+                    String init = attributes.getValue( XmlConstants.NAMESPACE_URI_EMPTY, XmlConstants.ATTR_INIT );
ecefdb
                     if ( init != null )
ecefdb
                     {
ecefdb
                         m_currentComponent.setInit( init );
ecefdb
@@ -252,7 +246,7 @@ public class XmlHandler implements KXml2SAXHandler
ecefdb
                 else if ( localName.equals( XmlConstants.EL_IMPL ) )
ecefdb
                 {
ecefdb
                     // Set the implementation class name (mandatory)
ecefdb
-                    m_currentComponent.setImplementationClassName( attributes.getAttribute( "class" ) );
ecefdb
+                    m_currentComponent.setImplementationClassName( attributes.getValue( XmlConstants.NAMESPACE_URI_EMPTY, "class" ) );
ecefdb
                 }
ecefdb
                 // 112.4.5 [...] Property Elements
ecefdb
                 else if ( localName.equals( XmlConstants.EL_PROPERTY ) )
ecefdb
@@ -260,18 +254,18 @@ public class XmlHandler implements KXml2SAXHandler
ecefdb
                     PropertyMetadata prop = new PropertyMetadata();
ecefdb
 
ecefdb
                     // name attribute is mandatory
ecefdb
-                    prop.setName( attributes.getAttribute( XmlConstants.ATTR_NAME ) );
ecefdb
+                    prop.setName( attributes.getValue( XmlConstants.NAMESPACE_URI_EMPTY, XmlConstants.ATTR_NAME ) );
ecefdb
 
ecefdb
                     // type attribute is optional
ecefdb
-                    if ( attributes.getAttribute( XmlConstants.ATTR_TYPE ) != null )
ecefdb
+                    if ( attributes.getValue( XmlConstants.NAMESPACE_URI_EMPTY, XmlConstants.ATTR_TYPE ) != null )
ecefdb
                     {
ecefdb
-                        prop.setType( attributes.getAttribute( XmlConstants.ATTR_TYPE ) );
ecefdb
+                        prop.setType( attributes.getValue( XmlConstants.NAMESPACE_URI_EMPTY, XmlConstants.ATTR_TYPE ) );
ecefdb
                     }
ecefdb
 
ecefdb
                     // 112.4.5: If the value attribute is specified, the body of the element is ignored.
ecefdb
-                    if ( attributes.getAttribute( XmlConstants.ATTR_VALUE ) != null )
ecefdb
+                    if ( attributes.getValue( XmlConstants.NAMESPACE_URI_EMPTY, XmlConstants.ATTR_VALUE ) != null )
ecefdb
                     {
ecefdb
-                        prop.setValue( attributes.getAttribute( XmlConstants.ATTR_VALUE ) );
ecefdb
+                        prop.setValue( attributes.getValue( XmlConstants.NAMESPACE_URI_EMPTY, XmlConstants.ATTR_VALUE ) );
ecefdb
                         m_currentComponent.addProperty( prop );
ecefdb
                     }
ecefdb
                     else
ecefdb
@@ -283,7 +277,7 @@ public class XmlHandler implements KXml2SAXHandler
ecefdb
                 // 112.4.5 Properties [...] Elements
ecefdb
                 else if ( localName.equals( XmlConstants.EL_PROPERTIES ) )
ecefdb
                 {
ecefdb
-                    final Properties props = readPropertiesEntry( attributes.getAttribute( "entry" ) );
ecefdb
+                    final Properties props = readPropertiesEntry( attributes.getValue( XmlConstants.NAMESPACE_URI_EMPTY, "entry" ) );
ecefdb
                     // create PropertyMetadata for the properties from the file
ecefdb
                     for ( Map.Entry<Object, Object> pEntry: props.entrySet() )
ecefdb
                     {
ecefdb
@@ -300,18 +294,18 @@ public class XmlHandler implements KXml2SAXHandler
ecefdb
                     PropertyMetadata prop = new PropertyMetadata();
ecefdb
 
ecefdb
                     // name attribute is mandatory
ecefdb
-                    prop.setName( attributes.getAttribute( XmlConstants.ATTR_NAME ) );
ecefdb
+                    prop.setName( attributes.getValue( XmlConstants.NAMESPACE_URI_EMPTY, XmlConstants.ATTR_NAME ) );
ecefdb
 
ecefdb
                     // type attribute is optional
ecefdb
-                    if ( attributes.getAttribute( XmlConstants.ATTR_TYPE ) != null )
ecefdb
+                    if ( attributes.getValue( XmlConstants.NAMESPACE_URI_EMPTY, XmlConstants.ATTR_TYPE ) != null )
ecefdb
                     {
ecefdb
-                        prop.setType( attributes.getAttribute( XmlConstants.ATTR_TYPE ) );
ecefdb
+                        prop.setType( attributes.getValue( XmlConstants.NAMESPACE_URI_EMPTY, XmlConstants.ATTR_TYPE ) );
ecefdb
                     }
ecefdb
 
ecefdb
                     // 112.4.5: If the value attribute is specified, the body of the element is ignored.
ecefdb
-                    if ( attributes.getAttribute( XmlConstants.ATTR_VALUE ) != null )
ecefdb
+                    if ( attributes.getValue( XmlConstants.NAMESPACE_URI_EMPTY, XmlConstants.ATTR_VALUE ) != null )
ecefdb
                     {
ecefdb
-                        prop.setValue( attributes.getAttribute( XmlConstants.ATTR_VALUE ) );
ecefdb
+                        prop.setValue( attributes.getValue( XmlConstants.NAMESPACE_URI_EMPTY, XmlConstants.ATTR_VALUE ) );
ecefdb
                         m_currentComponent.addFactoryProperty( prop );
ecefdb
                     }
ecefdb
                     else
ecefdb
@@ -323,7 +317,7 @@ public class XmlHandler implements KXml2SAXHandler
ecefdb
                 // 112.4.9 [...] Factory Properties Element
ecefdb
                 else if ( localName.equals( XmlConstants.EL_FACTORY_PROPERTIES ) )
ecefdb
                 {
ecefdb
-                    final Properties props = readPropertiesEntry( attributes.getAttribute( "entry" ) );
ecefdb
+                    final Properties props = readPropertiesEntry( attributes.getValue( XmlConstants.NAMESPACE_URI_EMPTY, "entry" ) );
ecefdb
                     // create PropertyMetadata for the properties from the file
ecefdb
                     for ( Map.Entry<Object, Object> pEntry: props.entrySet() )
ecefdb
                     {
ecefdb
@@ -340,21 +334,21 @@ public class XmlHandler implements KXml2SAXHandler
ecefdb
                     m_currentService = new ServiceMetadata();
ecefdb
 
ecefdb
                     // servicefactory attribute is optional
ecefdb
-                    if ( attributes.getAttribute( "servicefactory" ) != null )
ecefdb
+                    if ( attributes.getValue( XmlConstants.NAMESPACE_URI_EMPTY, "servicefactory" ) != null )
ecefdb
                     {
ecefdb
-                        m_currentService.setServiceFactory( attributes.getAttribute( "servicefactory" ).equals( "true" ) );
ecefdb
+                        m_currentService.setServiceFactory( attributes.getValue( XmlConstants.NAMESPACE_URI_EMPTY, "servicefactory" ).equals( "true" ) );
ecefdb
                     }
ecefdb
 
ecefdb
-                    if ( attributes.getAttribute( "scope" ) != null )
ecefdb
+                    if ( attributes.getValue( XmlConstants.NAMESPACE_URI_EMPTY, "scope" ) != null )
ecefdb
                     {
ecefdb
-                        m_currentService.setScope( attributes.getAttribute( "scope" ) );
ecefdb
+                        m_currentService.setScope( attributes.getValue( XmlConstants.NAMESPACE_URI_EMPTY, "scope" ) );
ecefdb
                     }
ecefdb
 
ecefdb
                     m_currentComponent.setService( m_currentService );
ecefdb
                 }
ecefdb
                 else if ( localName.equals( XmlConstants.EL_PROVIDE ) )
ecefdb
                 {
ecefdb
-                    m_currentService.addProvide( attributes.getAttribute( XmlConstants.ATTR_INTERFACE ) );
ecefdb
+                    m_currentService.addProvide( attributes.getValue( XmlConstants.NAMESPACE_URI_EMPTY, XmlConstants.ATTR_INTERFACE ) );
ecefdb
                 }
ecefdb
 
ecefdb
                 // 112.4.7 Reference element
ecefdb
@@ -363,58 +357,58 @@ public class XmlHandler implements KXml2SAXHandler
ecefdb
                     ReferenceMetadata ref = new ReferenceMetadata();
ecefdb
 
ecefdb
                     // name attribute is optional (since DS 1.1)
ecefdb
-                    if ( attributes.getAttribute( XmlConstants.ATTR_NAME ) != null )
ecefdb
+                    if ( attributes.getValue( XmlConstants.NAMESPACE_URI_EMPTY, XmlConstants.ATTR_NAME ) != null )
ecefdb
                     {
ecefdb
-                        ref.setName( attributes.getAttribute( XmlConstants.ATTR_NAME ) );
ecefdb
+                        ref.setName( attributes.getValue( XmlConstants.NAMESPACE_URI_EMPTY, XmlConstants.ATTR_NAME ) );
ecefdb
                     }
ecefdb
 
ecefdb
-                    ref.setInterface( attributes.getAttribute( XmlConstants.ATTR_INTERFACE ) );
ecefdb
+                    ref.setInterface( attributes.getValue( XmlConstants.NAMESPACE_URI_EMPTY, XmlConstants.ATTR_INTERFACE ) );
ecefdb
 
ecefdb
                     // Cardinality
ecefdb
-                    if ( attributes.getAttribute( "cardinality" ) != null )
ecefdb
+                    if ( attributes.getValue( XmlConstants.NAMESPACE_URI_EMPTY, "cardinality" ) != null )
ecefdb
                     {
ecefdb
-                        ref.setCardinality( attributes.getAttribute( "cardinality" ) );
ecefdb
+                        ref.setCardinality( attributes.getValue( XmlConstants.NAMESPACE_URI_EMPTY, "cardinality" ) );
ecefdb
                     }
ecefdb
 
ecefdb
-                    if ( attributes.getAttribute( "policy" ) != null )
ecefdb
+                    if ( attributes.getValue( XmlConstants.NAMESPACE_URI_EMPTY, "policy" ) != null )
ecefdb
                     {
ecefdb
-                        ref.setPolicy( attributes.getAttribute( "policy" ) );
ecefdb
+                        ref.setPolicy( attributes.getValue( XmlConstants.NAMESPACE_URI_EMPTY, "policy" ) );
ecefdb
                     }
ecefdb
 
ecefdb
-                    if ( attributes.getAttribute( "policy-option" ) != null )
ecefdb
+                    if ( attributes.getValue( XmlConstants.NAMESPACE_URI_EMPTY, "policy-option" ) != null )
ecefdb
                     {
ecefdb
-                        ref.setPolicyOption( attributes.getAttribute( "policy-option" ) );
ecefdb
+                        ref.setPolicyOption( attributes.getValue( XmlConstants.NAMESPACE_URI_EMPTY, "policy-option" ) );
ecefdb
                     }
ecefdb
 
ecefdb
-                    if ( attributes.getAttribute( "scope" ) != null )
ecefdb
+                    if ( attributes.getValue( XmlConstants.NAMESPACE_URI_EMPTY, "scope" ) != null )
ecefdb
                     {
ecefdb
-                        ref.setScope( attributes.getAttribute( "scope" ) );
ecefdb
+                        ref.setScope( attributes.getValue( XmlConstants.NAMESPACE_URI_EMPTY, "scope" ) );
ecefdb
                     }
ecefdb
 
ecefdb
-                    if ( attributes.getAttribute( "target" ) != null)
ecefdb
+                    if ( attributes.getValue( XmlConstants.NAMESPACE_URI_EMPTY, "target" ) != null)
ecefdb
                     {
ecefdb
-                        ref.setTarget( attributes.getAttribute( "target" ) );
ecefdb
+                        ref.setTarget( attributes.getValue( XmlConstants.NAMESPACE_URI_EMPTY, "target" ) );
ecefdb
                         PropertyMetadata prop = new PropertyMetadata();
ecefdb
                         prop.setName( (ref.getName() == null? ref.getInterface(): ref.getName()) + ".target");
ecefdb
-                        prop.setValue( attributes.getAttribute( "target" ) );
ecefdb
+                        prop.setValue( attributes.getValue( XmlConstants.NAMESPACE_URI_EMPTY, "target" ) );
ecefdb
                         m_currentComponent.addProperty( prop );
ecefdb
 
ecefdb
                     }
ecefdb
 
ecefdb
                     // method reference
ecefdb
-                    ref.setBind( attributes.getAttribute( "bind" ) );
ecefdb
-                    ref.setUpdated( attributes.getAttribute( "updated" ) );
ecefdb
-                    ref.setUnbind( attributes.getAttribute( "unbind" ) );
ecefdb
+                    ref.setBind( attributes.getValue( XmlConstants.NAMESPACE_URI_EMPTY, "bind" ) );
ecefdb
+                    ref.setUpdated( attributes.getValue( XmlConstants.NAMESPACE_URI_EMPTY, "updated" ) );
ecefdb
+                    ref.setUnbind( attributes.getValue( XmlConstants.NAMESPACE_URI_EMPTY, "unbind" ) );
ecefdb
 
ecefdb
                     // field reference
ecefdb
-                    ref.setField( attributes.getAttribute( "field" ) );
ecefdb
-                    ref.setFieldOption( attributes.getAttribute( "field-option" ) );
ecefdb
-                    ref.setFieldCollectionType( attributes.getAttribute( "field-collection-type" ) );
ecefdb
+                    ref.setField( attributes.getValue( XmlConstants.NAMESPACE_URI_EMPTY, "field" ) );
ecefdb
+                    ref.setFieldOption( attributes.getValue( XmlConstants.NAMESPACE_URI_EMPTY, "field-option" ) );
ecefdb
+                    ref.setFieldCollectionType( attributes.getValue( XmlConstants.NAMESPACE_URI_EMPTY, "field-collection-type" ) );
ecefdb
 
ecefdb
                     // DS 1.4 : references as parameter of the activator (method or constructor)
ecefdb
-                    if ( attributes.getAttribute( "parameter" ) != null)
ecefdb
+                    if ( attributes.getValue( XmlConstants.NAMESPACE_URI_EMPTY, "parameter" ) != null)
ecefdb
                     {
ecefdb
-                        ref.setParameter( attributes.getAttribute( "parameter" ) );
ecefdb
+                        ref.setParameter( attributes.getValue( XmlConstants.NAMESPACE_URI_EMPTY, "parameter" ) );
ecefdb
 
ecefdb
                     }
ecefdb
 
ecefdb
@@ -431,7 +425,7 @@ public class XmlHandler implements KXml2SAXHandler
ecefdb
             }
ecefdb
             catch ( Exception ex )
ecefdb
             {
ecefdb
-                throw new ParseException( "Exception during parsing", ex );
ecefdb
+                throw new SAXException( "Exception during parsing", ex );
ecefdb
             }
ecefdb
         }
ecefdb
 
ecefdb
@@ -445,14 +439,8 @@ public class XmlHandler implements KXml2SAXHandler
ecefdb
     }
ecefdb
 
ecefdb
 
ecefdb
-    /**
ecefdb
-     * Method called when a tag closes
ecefdb
-     *
ecefdb
-     * @param   uri
ecefdb
-     * @param   localName
ecefdb
-     */
ecefdb
     @Override
ecefdb
-    public void endElement( String uri, String localName )
ecefdb
+    public void endElement(String uri, String localName, String qName) throws SAXException
ecefdb
     {
ecefdb
         if ( overrideNamespace != null && XmlConstants.NAMESPACE_URI_EMPTY.equals( uri ) )
ecefdb
         {
ecefdb
@@ -475,71 +463,39 @@ public class XmlHandler implements KXml2SAXHandler
ecefdb
                 // 112.4.5 body expected to contain property value
ecefdb
                 // if so, the m_pendingProperty field would be null
ecefdb
                 // currently, we just ignore this situation
ecefdb
+            	m_pendingProperty.setValues( propertyBuilder.toString() );
ecefdb
+                m_currentComponent.addProperty( m_pendingProperty );
ecefdb
                 m_pendingProperty = null;
ecefdb
+                propertyBuilder = null;
ecefdb
             }
ecefdb
             else if ( localName.equals( XmlConstants.EL_FACTORY_PROPERTY ) && m_pendingFactoryProperty != null )
ecefdb
             {
ecefdb
                 // 112.4.5 body expected to contain property value
ecefdb
                 // if so, the m_pendingFactoryProperty field would be null
ecefdb
                 // currently, we just ignore this situation
ecefdb
+                m_pendingFactoryProperty.setValues( propertyBuilder.toString() );
ecefdb
+                m_currentComponent.addFactoryProperty( m_pendingFactoryProperty );
ecefdb
                 m_pendingFactoryProperty = null;
ecefdb
+                propertyBuilder = null;
ecefdb
             }
ecefdb
         }
ecefdb
     }
ecefdb
 
ecefdb
 
ecefdb
-    /**
ecefdb
-     * @see org.apache.felix.scr.impl.parser.KXml2SAXHandler#characters(java.lang.String)
ecefdb
-     */
ecefdb
     @Override
ecefdb
-    public void characters( String text )
ecefdb
+    public void characters(char[] ch, int start, int length) throws SAXException
ecefdb
     {
ecefdb
         // 112.4.5 If the value attribute is not specified, the body must contain one or more values
ecefdb
-        if ( m_pendingProperty != null )
ecefdb
+        if ( m_pendingProperty != null || m_pendingFactoryProperty != null )
ecefdb
         {
ecefdb
-            m_pendingProperty.setValues( text );
ecefdb
-            m_currentComponent.addProperty( m_pendingProperty );
ecefdb
-            m_pendingProperty = null;
ecefdb
-        }
ecefdb
-        if ( m_pendingFactoryProperty != null )
ecefdb
-        {
ecefdb
-            m_pendingFactoryProperty.setValues( text );
ecefdb
-            m_currentComponent.addFactoryProperty( m_pendingFactoryProperty );
ecefdb
-            m_pendingFactoryProperty = null;
ecefdb
+            if (propertyBuilder == null) {
ecefdb
+                propertyBuilder = new StringBuilder();
ecefdb
+            }
ecefdb
+            propertyBuilder.append(String.valueOf( ch, start, length));
ecefdb
         }
ecefdb
     }
ecefdb
 
ecefdb
 
ecefdb
-    /**
ecefdb
-     * @see org.apache.felix.scr.impl.parser.KXml2SAXHandler#processingInstruction(java.lang.String, java.lang.String)
ecefdb
-     */
ecefdb
-    @Override
ecefdb
-    public void processingInstruction( String target, String data )
ecefdb
-    {
ecefdb
-        // Not used
ecefdb
-    }
ecefdb
-
ecefdb
-
ecefdb
-    /**
ecefdb
-     * @see org.apache.felix.scr.impl.parser.KXml2SAXHandler#setLineNumber(int)
ecefdb
-     */
ecefdb
-    @Override
ecefdb
-    public void setLineNumber( int lineNumber )
ecefdb
-    {
ecefdb
-        // Not used
ecefdb
-    }
ecefdb
-
ecefdb
-
ecefdb
-    /**
ecefdb
-     * @see org.apache.felix.scr.impl.parser.KXml2SAXHandler#setColumnNumber(int)
ecefdb
-     */
ecefdb
-    @Override
ecefdb
-    public void setColumnNumber( int columnNumber )
ecefdb
-    {
ecefdb
-        // Not used
ecefdb
-    }
ecefdb
-
ecefdb
-
ecefdb
     /**
ecefdb
      * Reads the name property file from the bundle owning this descriptor. All
ecefdb
      * properties read from the properties file are added to the current
ecefdb
@@ -548,21 +504,21 @@ public class XmlHandler implements KXml2SAXHandler
ecefdb
      * @param entryName The name of the bundle entry containing the propertes
ecefdb
      *      to be added. This must not be null.
ecefdb
      *
ecefdb
-     * @throws ParseException If the entry name is null or no
ecefdb
+     * @throws SAXException If the entry name is null or no
ecefdb
      *      entry with the given name exists in the bundle or an error occurrs
ecefdb
      *      reading the properties file.
ecefdb
      */
ecefdb
-    private Properties readPropertiesEntry( String entryName ) throws ParseException
ecefdb
+    private Properties readPropertiesEntry( String entryName ) throws SAXException
ecefdb
     {
ecefdb
         if ( entryName == null )
ecefdb
         {
ecefdb
-            throw new ParseException( "Missing entry attribute of properties element", null );
ecefdb
+            throw new SAXException( "Missing entry attribute of properties element", null );
ecefdb
         }
ecefdb
 
ecefdb
         URL entryURL = m_bundle.getEntry( entryName );
ecefdb
         if ( entryURL == null )
ecefdb
         {
ecefdb
-            throw new ParseException( "Missing bundle entry " + entryName, null );
ecefdb
+            throw new SAXException( "Missing bundle entry " + entryName, null );
ecefdb
         }
ecefdb
 
ecefdb
         Properties props = new Properties();
ecefdb
@@ -574,7 +530,7 @@ public class XmlHandler implements KXml2SAXHandler
ecefdb
         }
ecefdb
         catch ( IOException ioe )
ecefdb
         {
ecefdb
-            throw new ParseException( "Failed to read properties entry " + entryName, ioe );
ecefdb
+            throw new SAXException( "Failed to read properties entry " + entryName, ioe );
ecefdb
         }
ecefdb
         finally
ecefdb
         {
ecefdb
-- 
ecefdb
2.21.1
ecefdb