xml

Create date intervals from number of hours

Create date intervals from number of hours Question: I am trying to create date intervals from the number of hours. Known variables are start_date, end_date and hour positions which are extracted from XML file. This is just one example as the time frame can also be one month with different hour positions and thus intervals. …

Total answers: 1

How to add an XML element to an existing text in a XML file with python

How to add an XML element to an existing text in a XML file with python Question: I have a problem with some values not being declared as XML elements in my XML files. But for further processing, I need them to be an element. Example: <A> <B id="254"> <C>Lore</C> <D>9</D> 12.34 </B> <B id="255"> …

Total answers: 1

Adding attributes with ascending integer values to XML elements only if they have children

Adding attributes with ascending integer values to XML elements only if they have children Question: I want to add the add attribute ‘id="number"’ to an existing file. id attributes should only be added if the element has at least one child. So right now my XML file looks like this: <Invoice> <Fussteil> <Summen> <QF/> <UstSatz>21.00</UstSatz> …

Total answers: 1

Access an element in an XML file and edit them using python

Access an element in an XML file and edit them using python Question: I have a rather sizable xml file that needs to be edited. I am trying to automate the editing process using python. I tried using the ‘xml.etree.ElementTree’ library in python but it seems like I am missing something. Can someone help me …

Total answers: 1

Adding attributes with ascending integer values to XML elements

Adding attributes with ascending integer values to XML elements Question: I want to add the add attribute ‘id="number"’ to an existing file. But the number should be ascending in the way they are added. So right now my XML file looks like this: <Invoice> <Fussteil> <Summen> <QF/> <UstSatz>21.00</UstSatz> <Betrag> <Bezeichnung>Steuerbetrag</Bezeichnung> <QF>124</QF> <Wert>8.8</Wert> </Betrag> <Betrag> <Bezeichnung>steuerpflichtiger …

Total answers: 1

Can't get value of nodes in XML file with Python

Can't get value of nodes in XML file with Python Question: I’m trying get data for all my rows in xml file, but i get data only for one column when use element_name ‘Data’ in other case i have empty list. Please help. My code: import pandas as pd import xml.etree.ElementTree as ET ns = …

Total answers: 2

"CData section too big" error when parsing XML with lxml

"CData section too big" error when parsing XML with lxml Question: I’m trying to parse a XML file using etree, parsing the file with tree = etree.parse(path_to_xml) is giving me an error : lxml.etree.XMLSyntaxError : CData section too big So I’ve tried to remove all the CData tags but in order to read it I …

Total answers: 1

Cant parse XML tree without bounds element from Pyosmium

Cant parse XML tree without bounds element from Pyosmium Question: I downloaded some data from OpenStreetMap, and have been sorting the data so i only have the nodes and ways that i need for my project (highways and the corresponding nodes in the references). To sort the XML file and create a new one, i …

Total answers: 1

XML parser in BeautifulSoup only scrapes the first symbol out of two

XML parser in BeautifulSoup only scrapes the first symbol out of two Question: I wish to read symbols from some XML content stored in a text file. When I use xml as a parser, I get the first symbol only. However, I got the two symbols when I use the xml parser. Here is the …

Total answers: 1