6 |
|
import java.util.ArrayList; |
7 |
|
|
8 |
|
import org.xml.sax.*; |
9 |
+ |
import org.xml.sax.helpers.*; |
10 |
|
import javax.xml.parsers.SAXParserFactory; |
11 |
|
import javax.xml.parsers.ParserConfigurationException; |
12 |
|
import javax.xml.parsers.SAXParser; |
17 |
|
* @author $Author$ |
18 |
|
* @version $Id$ |
19 |
|
*/ |
20 |
< |
public class XMLStringParser extends HandlerBase { |
20 |
> |
public class XMLStringParser extends DefaultHandler { |
21 |
|
|
22 |
|
//---FINAL ATTRIBUTES--- |
23 |
|
|
74 |
|
* "packet.attributes.machine_name" |
75 |
|
* within the XMLPacket. |
76 |
|
*/ |
77 |
< |
public void startElement (String name, AttributeList attrs) throws SAXException { |
77 |
> |
public void startElement (String name, Attributes attrs) throws SAXException { |
78 |
|
indentLevel++; |
79 |
|
tagList.add(name); |
80 |
|
if (attrs != null) { |
81 |
|
for (int i = 0; i < attrs.getLength (); i++) { |
82 |
< |
packet.addParam(getPath()+".attributes."+attrs.getName(i), attrs.getValue(i)); |
82 |
> |
packet.addParam(getPath()+".attributes."+attrs.getLocalName(i), attrs.getValue(i)); |
83 |
|
} |
84 |
|
} |
85 |
|
} |