/[cvs]/nfo/projects/netfraggle/bin/fraggleParserXML.py
ViewVC logotype

Diff of /nfo/projects/netfraggle/bin/fraggleParserXML.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1 by xabbu, Wed Aug 25 13:53:48 2004 UTC revision 1.2 by xabbu, Wed Aug 25 16:56:59 2004 UTC
# Line 2  Line 2 
2    
3  import sys  import sys
4  from xml.dom.ext.reader import Sax2  from xml.dom.ext.reader import Sax2
5  from xml.marshal import generic  from xml.marshal import *
6    
7  def create(parent):  def create(parent):
8      return fraggleParserXML()      return fraggleParserXML(parent)
9            
10  class fraggleParserXML:  class fraggleParserXML:
11      def __init_reader__():      def __init_reader__(self):
12          reader = Sax2.Reader()         self.reader = Sax2.Reader()
13          marshall = generic.Marshaller()      
14                    
15      def __init__(self,parent):      def __init__(self,parent):
16          self.__init_reader__()          self.__init_reader__()
17                    
18                    
19            
20      def parseXML(input):      def parseXML(self,input):
21          dom = self.reader.fromStream(input)          dom = self.reader.fromStream(input)
22          return dom          return dom
23            
24      def printXML(inputDom,outputLocation):      def printXML(self,inputDom,outputLocation):
25          file = open(outputLocation,"w")          file = open(outputLocation,"w")
26          self.reader.PrettyPrint(inputDom,file)          self.reader.PrettyPrint(inputDom,file)
27                    
28      def marshalXML(value,outputLocation):      def marshalXML(self,values,outputLocation):
29          file = open(outputLocation,"w")          file = open(outputLocation,"w")
         marshall.dump(value,file)  
           
           
30           # self.marshall.dump(values,file)
31            generic.dump(values,file)
32            #print generic.dumps(values)

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

MailToCvsAdmin">MailToCvsAdmin
ViewVC Help
Powered by ViewVC 1.1.26 RSS 2.0 feed