Libxml2 Python Manual
Hello! For libxml2, are there any manual. For this library?, i searched on google and just find the following URL xmlsoft.org Wich can not find any API manual. I will apreciate your support if have one for the library in python. -- http://mail.python.org/mailman/listinfo/python-list
Re: Libxml2 Python Manual
Tanks Nicholas. Yes, check the documentation effectively and yet it does not require C programminginformation if not for python, the only site I found examples and libxml2 for python propertiesis as follows http://mikekneller.com/kb/python/libxml2python / part1. And, apart from there to build a client very simple WSDL in python, but I want to improve the client and make it more dynamic, because now I have templates for responses and submissions of information from the XML, so I have generated WSDL objects for each service (sending / receiving / wrong response / OK response). I need to generate a parser that does not depend that I know what I expect and what tosend, if not, it is generic. This is a example for my client: *def getXMLInfo(self, xmlParam):* *#pdb.set_trace()* *try:* *document = libxml2.parseDoc(xmlParam)* *return document* *except Exception as ex:* *print Hubo un error en el parseo de la respuesta de ALU: ,ex* *loggingRegister.registrarLog(Hubo un error en el parseo de la respuesta de ALU: +str(ex))* * def getAllInformationResponse(self,parametro):* *pdb.set_trace()* *#===* *#informacion general de la cuenta en el XML* *#Para el contenido de getAllInformationResponse* *#===* *ReturncardNumber= None* *ReturncontractNumber=None* *ReturndefaultAccount=None* *ReturndefaultAccountIdentifierLogin=None* *ReturndefaultComOfferName=None* *ReturndefaultComOfferSubscription=None* *ReturnfriendAndFamilyList=None* *friendAndFamilyList=None* *ListaFnFs = {}* *ReturnfriendsAndFamilyListName=None* *Returnidentifier=None* *ReturnidentifierLogin=None* *Returnmsid=None* *Returnstatus=None* *#===* * * *#===* *#Variables para los elementos que contiene* . * #==* *#Se genera el objeto de slices para poder ingresar toda la informacion* * #==* *sliceGETALL = slicesALU(archivoDeLOGS)* * #==* * * *root = parametro.getRootElement()* *loggingRegister.registrarLog('Generando arbol XML...')* *#print root.name* *#pdb.set_trace()* *Body = root.children* *child = Body.children* *if (child.name == 'getAllInformationResponse'):* *#print child.name* *child = child.children* *#print child.name* *responseALU = child.children* *while responseALU is not None:* *if responseALU.type == 'element':* *#print responseALU.name* *#pdb.set_trace()* *if responseALU.name in ['cardNumber','contractNumber','defaultAccount','defaultAccountIdentifierLogin','defaultComOfferName','defaultComOfferSubscription','friendAndFamily * * List','friendsAndFamilyListName','identifier','identifierLogin','msid','status']: * .. Greetings. 2012/1/24 Nick Dokos nicholas.do...@hp.com Mauricio Martinez Garcia morfeo...@gmail.com wrote: For libxml2, are there any manual. For this library?, i searched on google and just find the following URL xmlsoft.org Wich can not find any API manual. Did you check under Reference Manual at http://xmlsoft.org? That's the second entry in the Main Menu. Nick -- *Mauricio Martínez Garcia *Soporte Aplicaciones / Soporte Operativo WDM Subdirección de Operación y Producción Dirección de Sistemas Filiberto Gómez 40-42, Fracc. Industrial Tlane. C.P. 54030 Tlanepantla, Edo. de México Nextel (ID): 52*1*18033 Móvil: +52 55.3520.4672 Directo: 4115.3252, Fax: 1018.3815 e-mail: mauricio.martinez.gar...@hp.com morfeo...@gmail.com mauricio.marti...@nextel.com.mx Si encuentras un trébol de cuatro hojas..., hallaras la felicidad. Pero ¿Sabes?, seguramente no la encontrarás, porque la felicidad se encuentra en silencio guardada en una jaula. EL trebol de Cuatro hojas nunca será de nadie... ¿Que te parece si te adueñas de un trébol de tres hojas?... 我渴望得到幸福, 我渴望得到幸福, 和你一起得到幸福, 成为你的幸福, 带我离开, 带我远离这个地方, 笼中之鸟, 不能飞翔的鸟, 不会哭泣的鸟, 孤单的鸟, 因此请带我离开, 我渴望得到幸福, 只要在你身边我便感到幸福, 只要你微笑我便感到幸福, 初次的心愿成为了最后的愿望, 这里是妖精等待着的, 我们两人的约定地点, 因此请代我离开, 为了忘却现实, 为了停留在梦幻之中, 为了永远能够思念你, 带我离开, 我渴望得到幸福, 找到四叶三叶草, 就能得到幸福 不过, 请保守秘密 三叶草的白花 在哪里开放? 它的叶有多少瓣? 四叶三叶草 我想令你得到幸福 可是我不能成为你的人 -- http://mail.python.org/mailman/listinfo/python-list
Error python + cx_Oracle :Oracle-Error-Message: ORA-01036: illegal variable name/number
Hi, i need help with the next error: ERR_PYTHON:Oracle-Error-Message: ORA-01036: illegal variable name/number, i used the cx_Oracle module, and the error not is only Oracle Error. The error its for that python don't translate the query, with the variables :VARIABLE when the VARIABLE is a number, this is th ecause of Oracle error. The template is: updateQUERYBSCS var. The code : == class HilosPrepago(object): def __init__(self,numhilos,listadoSegmentos,archivoLOG,arregloSalida): global NHilos global LSegmnts global ALog global listadoSalida global path_sal global queue global loggingRegister global updateQUERYBSCS queue = Queue() listadoSalida = arregloSalida ALog = archivoLOG LSegmnts = listadoSegmentos NHilos = numhilos loggingRegister = log_register(ALog) updateQUERYBSCS = UPDATE CONCIL_ICC SET CONTRATO_ICC = :CONTRATO_ICC, CONTRATO_ATS = :CONTRATO_BSCS, PLAN_ICC = :PLAN_ICC, PLAN_ATS = :PLAN_BSCS, IVA_ICC = :IVA_ICC, IVA_ATS = :IVA_BSCS, IVA_MAPEO = :IVA_MAPEO, PROFILE_ICC = :PROFILE_ICC, PROFILE_ATS = :PROFILE_BSCS, LEG_SOG_ICC = :LEG_SOG_ICC, LEG_SOG_ATS = :LEG_SOG_BSCS, LIC_SOG_ICC = :LIC_SOG_ICC, LIC_SOG_ATS = :LIC_SOG_BSCS, LEGLIG_SOG_ICC = :LEGLIC_SOG_ICC, LEGLIG_SOG_ATS = :LEGLIC_SOG_BSCS, LICN_SOG_ICC = :LICN_SOG_ICC, LICN_SOG_ATS = :LICN_SOG_BSCS, LDN_SOG_ICC = :LDN_SOG_ICC, LDN_SOG_ATS = :LDN_SOG_BSCS, REFILL_SOG_ICC = :REFILL_SOG_ICC, REFILL_SOG_ATS = :REFILL_SOG_BSCS, REFILL_PROM_ICC = :REFILL_PROM_ICC, REFILL_PROM_ATS = :REFILL_PROM_BSCS, DIA_RECARGA_ICC = :DIA_RECARGA_ICC, DIA_RECARGA_PROM_ICC = :DIA_RECARGA_PROM_ICC, DIA_RECARGA_ATS = :DIA_RECARGA_BSCS, CEL_IMSI_ICC = :CEL_IMSI_ICC, CEL_IMSI_ATS = :CEL_IMSI_BSCS, STATUS_ICC = :STATUS_ICC, STATUS_ATS = :STATUS_BSCS, ERROR_CONTRATO = to_number(:ERROR_CONTRATO), ERROR_PLAN = to_number(:ERROR_PLAN), ERROR_IVA_BSCS = to_number(:ERROR_IVA_BSCS), ERROR_IVA_ICC = to_number(:ERROR_IVA_ICC), ERROR_PROFILE = to_number(:ERROR_PROFILE), ERROR_LEGSOG = to_number(:ERROR_LEGSOG), ERROR_LICSOG = to_number(:ERROR_LICSOG), ERROR_LEGLICSOG = to_number(:ERROR_LEGLICSOG), ERROR_LICNSOG = to_number(:ERROR_LICNSOG), ERROR_LDNSOG = to_number(:ERROR_LDNSOG), ERROR_REFILLSOG = to_number(:ERROR_REFILLSOG), ERROR_REFILLPROMOCION = to_number(:ERROR_REFILLPROMOCION), ERROR_DIA_RECARGA = to_number(:ERROR_DIA_RECARGA), ERROR_DIA_RECARGAPROM = to_number(:ERROR_DIA_RECARGAPROM), ERROR_IMSI = to_number(:ERROR_IMSI), ERROR_STATUS = to_number(:ERROR_STATUS), ERROR_ENALTA = to_number(:ERROR_ENALTA), ERROR_ENELIMINACION = to_number(:ERROR_ENELIMINACION), PLANACTUALPROMO = :PLANACTUALPROMO, LLEVAPROMOCION = :LLEVAPROMOCION, DUPLICIDAD_DN = to_number(:DUPLICIDAD_DN), VALIDADO_PRODUCCION = :VALIDADO_PRODUCCION, CORREGIDO_EN_ALU = :CORREGIDO_EN_ALU, MENSAJE_CORRECCION = :MENSAJE_CORRECCION WHERE TELEFONO_ATS = :TELEFONO_BSCS #threading.Thread.__init__(self) def ejecutaHilo(self,lista,listaRegistrosOUT,archLog,hilo): from OracleConnections import OracleConnections print Iniciando la ejecucion para el hilo... %s % hilo listaUnica = lista.get() loggingRegister.registrarLog('Lista de datos...'+str(listaUnica)) FullNameLOG =
cath a timeout of httplib (Python 2.6.5)
Hi!. I have a problem with httplib and timeout. (I use python 2.6.5 and httplib) I have the next code for the http connection (its a WebService Client). === def ejecutaComandos(self,opcion, URL, commandString, conn, id): #pdb.set_trace() #fechatransacciones = conciliatorTime() #status = conn.status #date_transacc = fechatransacciones.getCompleteDate() try: try: enviaCommand = conn.request(POST, str(URL), commandString) respuestaCommand = conn.getresponse() except Exception as e: print 'Error de conexion: ',e #intentar=raw_input(Desea intentar nuevamente (S/N) : ) exit(1) respuestaWSDL = respuestaCommand.read() #print respuestaCommand nom_rand = str(random.choice('lmnopqrstuvwxyzABCDEFGHIJ'))+str(random.choice('abcdefghijk')) FileRand = nom_rand+'_tmp.xml' newFile = creaArchivos(FileRand,self.output) a = newFile.creaFile('w') #a = open('../output/responseXML.tmp', 'w') a.write(respuestaWSDL) a.close() #print XP_LOG+'respuesta de HLAPI recibida...'+str(date_transacc) #return respuestaWSDL return a.name #except httplib.HTTPException as he: except Exception as he: print Error de ejecucion ...: %s % (he) else: print Error inesperado... === I need resend the command when a timeout error present, my idea its use a while. === while (intentar=='S'): try: enviaCommand = conn.request(POST, str(URL), commandString) respuestaCommand = conn.getresponse() raise Exception except Exception as e: print 'Error de conexion: ',e intentar=raw_input(Desea intentar nuevamente (S/N) : ) if (intentar=='N'): exit(1) === But the information of enviaCommand it is lost, and it been only None, then fail resend. As I can resend the information without the command loses itself. Greetings and tanks!. -- Mauricio Martinez Garcia morfeo...@gmail.com Si encuentras un trébol de cuatro hojas..., hallaras la felicidad. Pero ¿Sabes?, seguramente no la encontrarás, porque la felicidad se encuentra en silencio guardada en una jaula. EL trebol de Cuatro hojas nunca será de nadie... ¿Que te parece si te adueñas de un trébol de tres hojas?... 我渴望得到幸福, 我渴望得到幸福, 和你一起得到幸福, 成为你的幸福, 带我离开, 带我远离这个地方, 笼中之鸟, 不能飞翔的鸟, 不会哭泣的鸟, 孤单的鸟, 因此请带我离开, 我渴望得到幸福, 只要在你身边我便感到幸福, 只要你微笑我便感到幸福, 初次的心愿成为了最后的愿望, 这里是妖精等待着的, 我们两人的约定地点, 因此请代我离开, 为了忘却现实, 为了停留在梦幻之中, 为了永远能够思念你, 带我离开, 我渴望得到幸福, 找到四叶三叶草, 就能得到幸福 不过, 请保守秘密 三叶草的白花 在哪里开放? 它的叶有多少瓣? 四叶三叶草 我想令你得到幸福 可是我不能成为你的人 -- http://mail.python.org/mailman/listinfo/python-list
error Compile libxml2 from python 2.6.4
Hi!. Have the next error on install libxml2. python/bin/python setup.py install failed to find headers for libxml2: update includes_dir This my version of python == /bscs/bscs/prod/523/WORK/MP/NORTEL/IN/MEXICO/CDRS/ATS/MONITOREO/reportes_Milton/python/bin/python Python 2.6.5 (r265:79063, Jul 21 2010, 13:05:40) [C] on hp-ux11 Type help, copyright, credits or license for more information. I'm Installing libxml2 for python 2.6.5, and this error break the install. The python path prefix is /bscs/bscs/prod/523/WORK/MP/NORTEL/IN/MEXICO/CDRS/ATS/MONITOREO/reportes_Milton/python, and i don't privileges of root. The configuration to be personalized, in prefix path. My compile line is: ./configure --with-python=/bscs/bscs/prod/523/WORK/MP/NORTEL/IN/MEXICO/CDRS/ATS/MONITOREO/reportes_Milton/python \ --prefix=/bscs/bscs/prod/523/WORK/MP/NORTEL/IN/MEXICO/CDRS/ATS/MONITOREO/reportes_Milton/libxml \ --with-libxml-include-prefix=/bscs/bscs/prod/523/WORK/MP/NORTEL/IN/MEXICO/CDRS/ATS/MONITOREO/reportes_Milton/pythonPruebas/libxml2/libxml2-INC/usr/local/include/libxml2/libxml This is the output when finalize compiling this is message: Enabled Schemas/Relax-NG support configure: creating ./config.status config.status: creating libxml2.spec config.status: creating Makefile config.status: creating include/Makefile config.status: creating include/libxml/Makefile config.status: creating doc/Makefile config.status: creating doc/examples/Makefile config.status: creating example/Makefile config.status: creating python/Makefile config.status: creating python/tests/Makefile config.status: creating include/libxml/xmlversion.h config.status: creating xml2-config config.status: creating libxml-2.0.pc config.status: creating libxml-2.0-uninstalled.pc config.status: creating xml2Conf.sh config.status: creating python/setup.py config.status: creating config.h config.status: config.h is unchanged config.status: executing depfiles commands And this is output of make install: Libraries have been installed in: /bscs/bscs/prod/523/WORK/MP/NORTEL/IN/MEXICO/CDRS/ATS/MONITOREO/reportes_Milton/python/lib/python2.6/site-packages If you ever happen to want to link against installed libraries in a given directory, LIBDIR, you must either use libtool, and specify the full pathname of the library, or use the `-LLIBDIR' flag during linking and do at least one of the following: - add LIBDIR to the `LD_LIBRARY_PATH' environment variable during execution - use the `-LLIBDIR' linker flag See any operating system documentation about shared libraries for more information, such as the ld(1) and ld.so(8) manual pages. Making install in tests No suffix list. No suffix list. /bin/sh ../../mkinstalldirs /bscs/bscs/prod/523/WORK/MP/NORTEL/IN/MEXICO/CDRS/ATS/MONITOREO/reportes_Milton/libxml/share/doc/libxml2-python-2.6.4/examples mkdir -p -- /bscs/bscs/prod/523/WORK/MP/NORTEL/IN/MEXICO/CDRS/ATS/MONITOREO/reportes_Milton/libxml/share/doc/libxml2-python-2.6.4/examples (for test in build.pyattribs.py tst.py tstxpath.py xpathext.py push.py pushSAX.py pushSAXhtml.py error.pyserialize.py validate.py tstURI.py cutnpaste.py xpathret.pyxpath.py outbuf.py inbuf.pyresolver.py regexp.py reader.py reader2.py reader3.py reader4.py reader5.py reader6.py reader7.py walker.py ctxterror.py readererr.py relaxng.pythread2.py tst.xml valid.xml invalid.xml; \ do ../.././install-sh -c -m 0644 ./$test /bscs/bscs/prod/523/WORK/MP/NORTEL/IN/MEXICO/CDRS/ATS/MONITOREO/reportes_Milton/libxml/share/doc/libxml2-python-2.6.4/examples ; done) This an issue?, or bug? Greetings. -- http://mail.python.org/mailman/listinfo/python-list