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.10 by pjm2, Fri Nov 17 11:07:32 2000 UTC vs.
Revision 1.13 by pjm2, Fri Nov 17 14:45:56 2000 UTC

# Line 32 | Line 32 | public class XMLPacketMaker extends HandlerBase {
32          try {
33  
34              // Parse the input
35 +            
36 +            xml.trim();
37 +            
38 +            //debug stuff
39 +            byte[] temp = xml.getBytes();
40 +            System.out.println("String length: "+temp.length+" ");
41 +            for (int i = 0 ; i < temp.length ; i++){
42 +                System.out.print((char)temp[i]);
43 +            }
44 +            
45 +            InputSource inputSource = new InputSource(new StringReader(xml));
46              SAXParser saxParser = factory.newSAXParser();
47 <            saxParser.parse(xml, new XMLPacketParser(packet));
47 >            saxParser.parse(inputSource, new XMLPacketParser(packet));
48  
38            // Print out the entire contents of the packet's HashMap.
39            System.out.println("XMLPacket contents: -");
40            packet.printAll();
41
49          }
50 +        //catch (IOException e){
51 +        //    System.out.println("IOException: "+e);
52 +        //}
53          catch (Throwable t) {
54 <            System.out.println("The recieved packet did not contain valid XML, so I'm gonna reject it.");
55 <            //t.printStackTrace ();
54 >            System.out.println("XMLPacketMaker - I just received an XML packet that did not contain valid XML.");
55 >            //System.out.println(e);
56 >            t.printStackTrace();
57 >            return null;
58          }
59          
60          return packet;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines