ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/i-scream/experimental/server/XMLReader/XMLPacketMaker.java
(Generate patch)

Comparing experimental/server/XMLReader/XMLPacketMaker.java (file contents):
Revision 1.5 by pjm2, Tue Nov 14 10:04:01 2000 UTC vs.
Revision 1.6 by pjm2, Tue Nov 14 10:15:54 2000 UTC

# Line 39 | Line 39 | public class XMLPacketMaker extends HandlerBase {
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) {
# Line 109 | Line 111 | public class XMLPacketMaker extends HandlerBase {
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  
# Line 138 | Line 140 | public class XMLPacketMaker extends HandlerBase {
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   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines