[XML-SIG] Re: XML-SIG digest, Vol 1 #465 - 2 msgs

Chris Shoulet chris@kla-inc.com
Thu, 16 Mar 2000 09:26:31 -0400

Can I post a job in the DC area on your distribution group?

>Send XML-SIG mailing list submissions to
>	xml-sig@python.org
>To subscribe or unsubscribe via the World Wide Web, visit
>	http://www.python.org/mailman/listinfo/xml-sig
>or, via email, send a message with subject or body 'help' to
>	xml-sig-request@python.org
>You can reach the person managing the list at
>	xml-sig-admin@python.org
>When replying, please edit your Subject line so it is more specific
>than "Re: Contents of XML-SIG digest..."
>Today's Topics:
>  1. Returning data from DocumentHandler (Bradley Marshall)
>  2. Re: Returning data from DocumentHandler (Andrew M. Kuchling)
>Message: 1
>Date: Thu, 24 Feb 2000 13:54:40 -0800 (PST)
>From: Bradley Marshall <bradmars@yahoo.com>
>To: xml-sig@python.org
>Subject: [XML-SIG] Returning data from DocumentHandler
>Hey guys,
>How do I return data from a ducumentHandler?  I am
>using sax to build a data structure from xml files.  I
>want to do something like :
>class DocHandler(DocumentHandler):
>    def endDocument(self):
>	return self.data
>Then I'm calling it like:
>dh = docHandler()
>p = parser()
>data = p.parseFile(file)
>but if I do :
>print data
>I get:
>If I do all my manipulations in endDocument(), it's
>fine, but I'd like to seperate those functionalities.
>Thanks a lot,
>Brad Marshall
>Do You Yahoo!?
>Talk to your friends online with Yahoo! Messenger.
>Message: 2
>From: "Andrew M. Kuchling" <akuchlin@mems-exchange.org>
>Date: Thu, 24 Feb 2000 17:19:50 -0500 (EST)
>To: xml-sig@python.org
>Subject: Re: [XML-SIG] Returning data from DocumentHandler
>Bradley Marshall writes:
> >class DocHandler(DocumentHandler):
> >....
> >    def endDocument(self):
> >	return self.data
> >
> >dh = docHandler()
> >p = parser()
> >p.setDocumentHandler(dh)
> >data = p.parseFile(file)
> >p.close()
>The parseFile() method doesn't return anything, so it'll always be
>None.  In the Java version of SAX, the parse() method is declared as
>void, in other words.  Why not just access the attribute .data of your
>DocHandler class?  You can also add an accessor method,
>.getWhateverData(), to your class, if you prefer accessor methods to
>A.M. Kuchling			http://starship.python.net/crew/amk/
>Perhaps God made cats so that man might have the pleasure of fondling the
>    -- Robertson Davies, _The Diary of Samuel Marchbanks_
>End of XML-SIG Digest_______________________________________________
>XML-SIG maillist  -  XML-SIG@python.org

Chris Shoulet
Ken Leiner Associates, Inc.
Voice:  (800) 989-8803 or (301) 933-8800x141
Fax:  (301) 933-8808
Email:  chris@kla-inc.com

Nationwide recruiting for the computer industry...
To subscribe to the monthly newsletter please send a blank email to 
the appropriate (case sensitive) address:
WHOLE US	ITSEARCH-subscribe@listbot.com
WESTERN US	ITWEST-subscribe@listbot.com
MOUNTAIN US	ITMOUNTAIN-subscribe@listbot.com
CENTRAL US	ITCENTRAL-subscribe@listbot.com
EASTERN US	ITEASTERN-subscribe@listbot.com
DC METRO AREA	ITDC-subscribe@listbot.com
***If forwarding over material please send as a word attachment***