I am using python 2.7.2. and dom parser to read the data on several xml files. And export .db file to use on sql server. I have learned how to export the files, but XML tags are also included on my data tables. Here is the basic code :
from xml.dom import minidom
import sqlite3
xmldoc = minidom.parse('c:\dd\l2con\l2connection.xml')
coId = xmldoc.getElementsByTagName('id')
and each element are like this :
>>> coId[0]
<DOM Element: id at 0x249cf30>
>>> print coId[0].toxml()
<id>45859</id>
>>> coId[1]
<DOM Element: id at 0x24ac328>
>>> print coId[1].toxml()
<id>46889</id>
>>>
where they should look like this: without the xml tags
>coId[0].toxml()
45859
>coId[1].toxml()
46889
Deleting the tags from xml probably won't work for this case.This way python can't read the xml file. Is there any way you can advise me on this subject.Any help will be appreciated.
Thank You
Yusuf