39 |
|
saxParser.parse(new File(args[0]), new XMLPacketMaker(packet)); |
40 |
|
|
41 |
|
// Print out some things from the packet: - |
42 |
+ |
System.out.println("bung.wibble="+packet.getParam("bung.wibble")); |
43 |
+ |
System.out.println("bung.ping.value1="+packet.getParam("bung.ping.value1")); |
44 |
|
|
45 |
|
|
46 |
|
} catch (Throwable t) { |
111 |
|
String s = new String(buf, offset, len); |
112 |
|
if (!s.trim().equals("")) { |
113 |
|
emit (s); |
114 |
< |
packet.addParam((String)tagList.get(tagList.size()-1), s); |
114 |
> |
packet.addParam(getPath(), s); |
115 |
|
} |
116 |
|
} |
117 |
|
|
140 |
|
} catch (IOException e) { |
141 |
|
throw new SAXException ("I/O error", e); |
142 |
|
} |
143 |
+ |
} |
144 |
+ |
|
145 |
+ |
private String getPath () { |
146 |
+ |
String path = (String)tagList.get(0); |
147 |
+ |
if (tagList.size() > 0) { |
148 |
+ |
for (int i = 1 ; i < tagList.size() ; i++) { |
149 |
+ |
path = path + "." + (String)tagList.get(i); |
150 |
+ |
} |
151 |
+ |
} |
152 |
+ |
return path; |
153 |
|
} |
154 |
|
} |