I'm trying to write a Python script that will go through Rows and put them into my database
This is a structure of my xml:
Root>
-<SvcNf>
-<PersonNf>
-<PersonList>
-<Row>
<SysName>MI6</SysName>
<ServerDt>2016-10-28 03:00:12 +03:00</ServerDt>
<UID>9457A55E17341AA7ASDEDS057A8BFFF3</UID>
<PersID>007</PersID>
<Emp_name>James Bond</Emp_name>
<EventID>25</EventID>
<EventTXT>Drinking alcohol</EventTXT>
<CauseEventID>03</CauseEventID>
<CauseEventTXT>Martini with vodka</CauseEventTXT>
<EventBegda>2017-10-18</EventBegda>
<EventEndda>2017-10-18</EventEndda>
<AccrualsSum>171.0</AccrualsSum>
<AccrualsProz>0.0</AccrualsProz>
<AccrualsName>Chinees_</AccrualsName>
<OrderNum>P-336</OrderNum>
<Perg>0</Persg>
<Perk>15</Persk>
<Awart/>
</Row>
-<Row>
.....
</Row>
<Row/>
</PersonList>
</PersonNf>
</SvcNf>
</Root>
So, when i use this code to Parse XML:
ResultSet_Py_List = []
root = ET.parse(events)
nodes = root.findall('.//Row')
for node in nodes:
for child in node:
ResultSet_Py_List.append(child.text)
The nominal Row value, which I want, is
['MI6', '2016-10-28 03:00:12 +03:00', '9457A55E17341AA7ASDEDS057A8BFFF3', etc]
[Row2]
[Row3]
Now, its like: [Row1,Row2,Row3]
[EDIT]
All characters is like Ф.
To heal it:
tostring(doc.getroot(), 'unicode')
[EDIT]
I used 2nd example but now i have Oracle error: ORA-01704: string literal too long.