So, here's my game plan .....xpath in python
Here's my xmlSo this xml is stored in a database ( ca ) , I need to extract this "data" to get all these value layer out and store them to another database ( a ) : Here's what's I came up so far..\[code\]import pyodbcfrom lxml import etreefrom StringIO import StringIOcon_ca = pyodbc.connect(..)con_a = pyodbc.connect(..)cur_ca = con_ca.cursor()cur_c = con_c.cursor() cur_ca.execute("""select id_original,datafrom table""")rows_ca = cur_ca.fetchall()for row in rows_ca: id_original = id_original x = str(row.data) root = etree.fromstring(x) BValid = etree.XPath('/Data/Response/Detail/B/Valid') BPass = etree.XPath('/Data/Response/Detail/B/Pass') BDetails = etree.XPath('/Data/Response/Detail/B/Details') BCode = etree.XPath('/Data/Response/Detail/B/Code') BDecisionS = etree.XPath('/Data/Response/Detail/B/Decision/Result') BDecisionB = etree.XPath('/Data/Response/Detail/B/Decision/Bucket') con_a.execute("""INSERT INTO table2 (id_original,BValid,BPass,BDetails,BCode,BDecisionS BDecisionB) VALUES(?, ?, ?,?, ?, ?, ?)""")\[/code\].. everything work out , except after fetchall() I was able to get ('//text') : but how can I use Xpath to go into specific node to get value or text from this example ?