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.1 by pjm2, Mon Nov 13 12:31:27 2000 UTC vs.
Revision 1.2 by pjm2, Tue Nov 14 09:18:20 2000 UTC

# Line 24 | Line 24 | public class XMLPacketMaker extends HandlerBase
24  
25              // Parse the input
26              SAXParser saxParser = factory.newSAXParser();
27 <            saxParser.parse( new File(argv [0]), new Echo03() );
27 >            saxParser.parse( new File(argv [0]), new XMLPacketMaker() );
28  
29          } catch (Throwable t) {
30              t.printStackTrace ();
# Line 45 | Line 45 | public class XMLPacketMaker extends HandlerBase
45      throws SAXException
46      {
47          nl();
48 <        nl();
48 >        //nl();
49          emit ("START DOCUMENT");
50          nl();
51 <        emit ("<?xml version='1.0' encoding='UTF-8'?>");
51 >        //emit ("<?xml version='1.0' encoding='UTF-8'?>");
52      }
53  
54      public void endDocument ()
# Line 67 | Line 67 | public class XMLPacketMaker extends HandlerBase
67      throws SAXException
68      {
69          indentLevel++;
70 <        nl(); emit ("ELEMENT: ");
71 <        emit ("<"+name);
70 >        //nl(); emit ("ELEMENT: ");
71 >        //emit ("<"+name);
72          if (attrs != null) {
73              for (int i = 0; i < attrs.getLength (); i++) {
74                  nl();
# Line 79 | Line 79 | public class XMLPacketMaker extends HandlerBase
79                  emit ("\"");
80              }
81          }
82 <        if (attrs.getLength() > 0) nl();
83 <        emit (">");
82 >        //if (attrs.getLength() > 0) nl();
83 >        //emit (">");
84      }
85  
86      public void endElement (String name)
87      throws SAXException
88      {
89 <        nl();
90 <        emit ("END_ELM: ");
91 <        emit ("</"+name+">");
89 >        //nl();
90 >        //emit ("END_ELM: ");
91 >        //emit ("</"+name+">");
92          indentLevel--;
93      }
94  
95      public void characters (char buf [], int offset, int len) throws SAXException {
96 <        nl(); emit ("CHARS:   ");
96 >        nl(); emit ("Value:   ");
97          String s = new String(buf, offset, len);
98          if (!s.trim().equals("")) emit (s);
99      }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines