ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/i-scream/projects/cms/source/util/uk/org/iscream/cms/util/XMLPacketMaker.java
(Generate patch)

Comparing projects/cms/source/util/uk/org/iscream/cms/util/XMLPacketMaker.java (file contents):
Revision 1.11 by tdb, Sat Mar 10 00:49:39 2001 UTC vs.
Revision 1.12 by tdb, Sat Mar 10 02:03:55 2001 UTC

# Line 17 | Line 17 | import javax.xml.parsers.SAXParser;
17   * @author  $Author$
18   * @version $Id$
19   */
20 < public class XMLPacketMaker {
20 > public class XMLPacketMaker extends DefaultHandler {
21  
22   //---FINAL ATTRIBUTES---
23  
# Line 25 | Line 25 | public class XMLPacketMaker {
25       * The current CVS revision of this class
26       */
27      public final String REVISION = "$Revision$";
28    
29    /**
30     * A static reference to the system saxParser
31     * Use the default (non-validating) parser
32     */
33    private static SAXParser saxParser = null;
34    private static SAXParserFactory factory = SAXParserFactory.newInstance();
28      
29   //---STATIC METHODS---
30  
# Line 46 | Line 39 | public class XMLPacketMaker {
39          _xml = xml;
40      }
41  
42 +    /**
43 +     * A static reference to the system saxParser factory
44 +     */
45 +    private static SAXParserFactory factory = SAXParserFactory.newInstance();
46 +
47 +
48   //---PUBLIC METHODS---
49  
50      /**
# Line 63 | Line 62 | public class XMLPacketMaker {
62          try {
63              // Parse the input
64              InputSource inputSource = new InputSource(new StringReader(_xml));
65 <            
67 <            if (saxParser == null) {
68 <                saxParser = factory.newSAXParser();
69 <            }
65 >            SAXParser saxParser = factory.newSAXParser();
66              
67              saxParser.parse(inputSource, new XMLStringParser(packet));
68          }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines