--- projects/cms/source/util/uk/org/iscream/cms/util/XMLStringParser.java 2001/01/28 05:47:05 1.6 +++ projects/cms/source/util/uk/org/iscream/cms/util/XMLStringParser.java 2001/03/10 00:49:39 1.8 @@ -6,6 +6,7 @@ import java.io.*; import java.util.ArrayList; import org.xml.sax.*; +import org.xml.sax.helpers.*; import javax.xml.parsers.SAXParserFactory; import javax.xml.parsers.ParserConfigurationException; import javax.xml.parsers.SAXParser; @@ -14,16 +15,16 @@ import javax.xml.parsers.SAXParser; * XMLStringParser - Used to assist in creating XMLPacket objects. * * @author $Author: tdb $ - * @version $Id: XMLStringParser.java,v 1.6 2001/01/28 05:47:05 tdb Exp $ + * @version $Id: XMLStringParser.java,v 1.8 2001/03/10 00:49:39 tdb Exp $ */ -public class XMLStringParser extends HandlerBase { +public class XMLStringParser extends DefaultHandler { //---FINAL ATTRIBUTES--- /** * The current CVS revision of this class */ - public final String REVISION = "$Revision: 1.6 $"; + public final String REVISION = "$Revision: 1.8 $"; //---STATIC METHODS--- @@ -73,12 +74,12 @@ public class XMLStringParser extends HandlerBase { * "packet.attributes.machine_name" * within the XMLPacket. */ - public void startElement (String name, AttributeList attrs) throws SAXException { + public void startElement (String name, Attributes attrs) throws SAXException { indentLevel++; tagList.add(name); if (attrs != null) { for (int i = 0; i < attrs.getLength (); i++) { - packet.addParam(getPath()+".attributes."+attrs.getName(i), attrs.getValue(i)); + packet.addParam(getPath()+".attributes."+attrs.getLocalName(i), attrs.getValue(i)); } } } @@ -101,9 +102,7 @@ public class XMLStringParser extends HandlerBase { */ public void characters (char[] buf, int offset, int len) throws SAXException { String s = new String(buf, offset, len); - if (!s.trim().equals("")) { - packet.addParam(getPath(), s); - } + packet.addParam(getPath(), s); } /**