SAX start element even handler
( self, name, oAttributes )
| 176 | |
| 177 | |
| 178 | def startElement( self, name, oAttributes ): |
| 179 | 'SAX start element even handler' |
| 180 | global fDebug |
| 181 | |
| 182 | if fDebug: |
| 183 | print "startElement(",name.encode(),")" |
| 184 | attr={ } |
| 185 | for oKey in oAttributes.getNames( ): |
| 186 | oData = oAttributes.getValue( oKey ) |
| 187 | if string.strip( oKey ): |
| 188 | key = oKey.encode( ) |
| 189 | data = oData.strip( ) |
| 190 | attr[key] = data.encode( ) |
| 191 | parent = self.listDataStack[ -1 ] |
| 192 | node = xmlElement( name.encode(), parent, attr ) |
| 193 | if parent is not None: |
| 194 | parent.addChild( node ) |
| 195 | self.listDataStack.append( node ) |
| 196 | self.data = '' |
| 197 | |
| 198 | |
| 199 | def characters( self, data ): |