Re: Problem with "&" charater in xml.

2006-07-17 Thread Stefan Behnel
Kirt wrote: > i have walked a directory and have written the foll xml document. > one of the folder had "&" character so i replaced it by "&" > #--test1.xml > > C:\Documents and Settings\Administrator\Desktop\1\bye > w&y > [...] > #---

Re: Problem with "&" charater in xml.

2006-07-13 Thread Joe Kesselman
Note that any good SAX tutorial will demonstrate how to buffer the characters() events, if you don't feel like reinventing the solution yourself. -- http://mail.python.org/mailman/listinfo/python-list

Re: Problem with "&" charater in xml.

2006-07-13 Thread George Bina
A SAX parser can notify a text node by calling any number of times the characters method so you need to accumulate all the information you receive on the characters method and output the text when you get a notification different than characters. Best Regards, George --

Re: Problem with "&" charater in xml.

2006-07-13 Thread Kirt
thanx stefan ur approach worked. Stefan Behnel wrote: > Kirt wrote: > > How do i append characters to a string? > > I think the normal approach is to store an empty string (or list) in an > attribute in startElement(), append to it in characters() and use the result > in endElement(). > > def star

Re: Problem with "&" charater in xml.

2006-07-13 Thread Stefan Behnel
Kirt wrote: > How do i append characters to a string? I think the normal approach is to store an empty string (or list) in an attribute in startElement(), append to it in characters() and use the result in endElement(). def startElement(self, ...): self.chars = '' def characters(self, s):

Re: Problem with "&" charater in xml.

2006-07-12 Thread Kirt
How do i append characters to a string? actually my entire handler code is class oldHandler(ContentHandler): def __init__(self): self.fn = 0 self.dn = 0 self.i=[] self.x=""

Re: Problem with "&" charater in xml.

2006-07-12 Thread Stefan Behnel
Kirt wrote: > i have walked a directory and have written the foll xml document. > one of the folder had "&" character so i replaced it by "&" > #--test1.xml > > C:\Documents and Settings\Administrator\Desktop\1\bye > w&y > > def.txt > 200607130417 > > > > C:\Docum

Problem with "&" charater in xml.

2006-07-12 Thread Kirt
i have walked a directory and have written the foll xml document. one of the folder had "&" character so i replaced it by "&" #--test1.xml C:\Documents and Settings\Administrator\Desktop\1\bye w&y def.txt 200607130417 C:\Documents and Settings\Administrator\Deskt