Skip to main content

All Questions

Tagged with or
Filter by
Sorted by
Tagged with
0 votes
1 answer
52 views

The following code: import xml.etree.ElementTree as ET essai = '''<?xml version='1.0' standalone='yes' ?> <LVData xmlns="http://www.ni.com/LVData"> <Version>18.0.1f4</...
Baps131's user avatar
  • 19
0 votes
1 answer
83 views

I'm trying to generate the below XML file using the data populated in a list: <?xml version="1.0" encoding="UTF-8"?> <testsuites tests="65" failures="0"...
Harry's user avatar
  • 4,154
2 votes
1 answer
136 views

I am trying to read records from an XML file using a Python script, then write the data to a CSV one record per line. My current implementation is throwing an IndexError when I try to get the first ...
Brett Byers's user avatar
2 votes
2 answers
93 views

I'm having trouble extracting a specific element text from a soap response. Other elements seems to be working fine. I have tried the following: Python 3.13.3 (main, Apr 8 2025, 13:54:08) [Clang 16.0....
ads's user avatar
  • 1,743
0 votes
1 answer
71 views

I'm trying to batch-process a couple of XML files through a python script, with the XML files having line breaks in some of their attributes like so: <?xml version='1.0' encoding='UTF-8'?> <...
Tim Meyer's user avatar
  • 12.7k
0 votes
1 answer
32 views

I have the following XML element: <Content> <Controller Use="Context" Name="Base_Project_Maximum_Connections"> <DataTypes Use="Context"> <...
ROBERT RICHARDSON's user avatar
1 vote
1 answer
63 views

I'd like to be able to parse some info from xml data while uses namespaces. I have been trying to read/follow steps in: https://docs.python.org/3/library/xml.etree.elementtree.html#parsing-xml-with-...
most.of.a.shark's user avatar
0 votes
1 answer
46 views

here is the XML: <multi-routing-engine-results> <multi-routing-engine-item> <re-name>node0</re-name> <source-resource-usage-pool-information> ...
robm's user avatar
  • 1,217
0 votes
2 answers
57 views

I have the following xml: <multi-routing-engine-results> <multi-routing-engine-item> <re-name>node0</re-name> <source-resource-usage-pool-information> ...
robm's user avatar
  • 1,217
0 votes
1 answer
218 views

Question: What is the best way to control chunk size used by standard XML iterative parsers in Python? If single elements* aren't the optimal chunk size for use by iterative parsers, then what is the ...
hasManyStupidQuestions's user avatar
1 vote
4 answers
146 views

Doing my first steps in python I try to parse and update a xml file. The xml is as follows: <?xml version="1.0" encoding="utf-8"?> <?xml-stylesheet href="util/style/...
fascynacja's user avatar
  • 3,186
1 vote
1 answer
56 views

I've got a question about parsing a rather complicated XML document in Python with xml.etree.ElementTree. The XML is scap-security-guide-0.1.75/ssg-ubuntu2204-ds.xml from https://github.com/...
John's user avatar
  • 339
-1 votes
3 answers
85 views

I am preparing a Python script to create an XML like: <?xml version="1.0" encoding="UTF-8"?> <FileInfo> <FileFormatVersion>1.0</FileFormatVersion> &...
Andrew Haworth's user avatar
1 vote
2 answers
69 views

I have a .xml in string format xmlString which looks like below <entry xmlns="http://www.w3.org/2004/tom"> <id>urn:contentItem:7WBG-8H88-Y898-B277-00000-00-1</id> <...
user75415's user avatar
2 votes
1 answer
97 views

I am trying to parse xml with namespace and attributes. I'm using XML library in Python and since I'm new with this, cannot find solution even I checked over this forum, there are similar questions ...
Pecooou's user avatar
  • 137
1 vote
1 answer
124 views

I have an XML file "bib_full-001664.xml" and want to find element: <issn pub-type="ppub">2544-1558</issn> My XML file: <OAI-PMH xmlns="http://www.openarchives....
Adam Jurkiewicz's user avatar
0 votes
2 answers
68 views

I have next code to parse one XML string, and then add a new node to the XML. But you can see my code can only add <category term="Platform Version" value="Linux_6.6" /> ...
atline's user avatar
  • 32.1k
1 vote
2 answers
81 views

I want to merge two xml files using Python: File1.xml <?xml version='1.0' encoding='ASCII'?> <MyData> <Elements> <Element> <ElementID>15</ElementID> ...
Sheldon's user avatar
  • 4,780
0 votes
1 answer
297 views

I'm developing a package that can be used by both users of lxml and the default xml package. ATM I have a small try:except for the lxml import, but sometimes the user uses functions like dump() from ...
Bharel's user avatar
  • 27.5k
0 votes
1 answer
54 views

I need to make a Python script to fetch cameras configurations and check on the stuff wrote in their OSD. I made code that downloads XML file directly from them and then parses through it in order to ...
Tano Dz's user avatar
0 votes
1 answer
115 views

I want to use ElementTree to modify an XML-document and to keep it comparable, I want to have the same namespace-prefixes in the new file as in the old file. However, the default_namespace= argument ...
treuss's user avatar
  • 2,406
0 votes
1 answer
49 views

I'm using Python's xml.etree.ElementTree to generate XML, and I’m encountering an issue where an XML subelement appears under a different tag than intended. My function looks like this: def ...
Daniel's user avatar
  • 7
0 votes
1 answer
118 views

Trying to parse an XML report file in my Gitlab runner and the logic is failing on the line below. Simplified the code so I can post for help. import xml.etree.ElementTree as ET test_xml = ''' <...
Tom C's user avatar
  • 1
1 vote
1 answer
59 views

Given an Element from etree, I would like to print only the opening tag. This would be immensely useful for debugging. For example: >>> from lxml import etree >>> elem = etree....
NeatNit's user avatar
  • 675
0 votes
2 answers
115 views

I am stitching together XML files using the lxml.etree library and namespaces are being dropped on write. Input.xml <?xml version="1.0" encoding="UTF-8"?> <haul> &...
Cody Smith's user avatar
0 votes
1 answer
59 views

I am trying to parse Word Documents using their XML; I am doing this through using Python's xml.etree.ElementTree module. This is the code I used to create a plain .txt file output for a given Word ...
Salaam Hamad's user avatar
0 votes
1 answer
41 views

I have the following code to edit XML import xml.etree.ElementTree as ET data = b'<?xml version="1.0" encoding="UTF-8"?><aaaa version="1.0"><zzz>xxxxxx&...
Polo1990's user avatar
0 votes
1 answer
55 views

I'm only getting value1 when using .findall('string') and rest is ignored. How to get whole value? xml file input: <resources> <string name="key">value1 <b>value2</b>...
Gorthez's user avatar
  • 421
0 votes
1 answer
66 views

Working with python : My program opens a template in XML format, insert the user info, and then saves it. The template is the following : <ids xmlns="http://standards.buildingsmart.org/IDS&...
Enrra's user avatar
  • 69
0 votes
1 answer
62 views

I have a file tree like : 2_Product 2-1_CategoryName1_Product 2-1-1_Name1_Product LLL_nomenclature1_product.zip LLL_nomenclature1_product (folder) ...
Camille's user avatar
  • 71
0 votes
1 answer
70 views

I can't wrap my head around this one. Why is find() not finding the appended element when it can find the exact same element when it is loaded from an XML string? The following function creates an ...
Fontanka16's user avatar
  • 1,413
0 votes
1 answer
54 views

I am trying to use ElementTree to parse information out of a .targets file from a NuGet package. What I am trying to find is the tag <AdditionalIncludeDirectories>. I am using the following ...
meetaig's user avatar
  • 925
0 votes
0 answers
95 views

I'm using python to generate an XML document for a third party. The third party has very precise ideas about how the final xml file shall look like. In my case it wants me to define a namespace in the ...
principal-ideal-domain's user avatar
1 vote
2 answers
110 views

XML 1: <invoiceCopy> <document> <invoicenumber>1245678</invoicenumber> <invoicedate>2024-06-06</invoicedate> <pdffilename>12345678.pdf</...
Pooja's user avatar
  • 119
-2 votes
1 answer
43 views

I am trying to load data from many xml files with etree.ElementTree. The data in the xml looks like this sample: <mydata> <Record> <Field name="ParaA">2927695</Field&...
credenco's user avatar
  • 281
3 votes
0 answers
115 views

Why does the Python documentation say this about xml.etree.ElementTree's Element.makeelement() method? Do not call this method, use the SubElement() factory function instead It's specifically not ...
thomasrutter's user avatar
0 votes
1 answer
56 views

Let's say we have the following xml string xml_string = ''' <Wikimedia> <projects> <project name="Wikipedia" launch="2001-01-05"> <editions> ...
Confounded's user avatar
0 votes
3 answers
100 views

I'm currently in the process of wrangling bibliographic information from an XML structure into, literally, almost anything else useable. My final move is to pull the value of the "xml:id" ...
K Mc's user avatar
  • 1
0 votes
0 answers
27 views

I have an app that creates an xml file. It looks like 3 xml files combined into one? I want to parse the file but when opening it with elementtree it shows an error "junk after document element: ...
bob_the_bob's user avatar
0 votes
2 answers
57 views

I have a script which I want to use to create Write Files to update a serial number on a device. It does a folder/file path check -> Copies the Read.xml and Creates a Write.xml (Copy) -> Obtains ...
M.Tomlinson's user avatar
0 votes
1 answer
77 views

I wanted to add Element with Subelements to my xml file using Python. But after changing file the Element and Subelement looks like a line, not like a xml-tree. I do this: tree = ET.parse('...
Bobcat Chemist's user avatar
0 votes
2 answers
67 views

I have looked in other questions regarding this issue and none of them helped me. I'm parsing a XML with ElementTree and I am having problem finding a specific tag, which may be optional, while I can ...
Rafael's user avatar
  • 35
1 vote
0 answers
109 views

I am editing an XML file in Python 3.10 using ElementTree. I need certain empty elements to use self-closing tags, i.e. <a/>, whereas others need to be written out in full <b></b>. ...
ngauge's user avatar
  • 11
1 vote
1 answer
33 views

I need to sort the "line" elements of the following sample XML with Elementtree by reqdate (desc - most recent to oldest). <doc> <header> <ordernum>1234</...
anterys's user avatar
  • 23
0 votes
1 answer
69 views

I have xml data, which looks like this: <item n="main"><anchor type="b" ana="regO.lemID_12" xml:id="TidB13" />Stuttgart<anchor type="e" ...
clara's user avatar
  • 1
0 votes
1 answer
73 views

I want to get a first child of a XML document (without knowing the exact names of the nodes), multi levels deep. I'm porting some code from JS to Python. This was the JS code: let document = ...
Mathias's user avatar
0 votes
1 answer
283 views

Firstly, I am a beginner, just bordering on intermediate with python, so please be patient with my approach to this problem. I was working on a web scraping mini project using lxml etree and requests (...
intmainvoid's user avatar
0 votes
2 answers
324 views

I'm reading an XML with python and ElementTree and am struggling with xmlns and xsi tags. The top of my XML looks like this. <?xml version="1.0" encoding="utf-8"?> <?xml-...
EdwardBurton's user avatar
1 vote
1 answer
74 views

the aim of the code is to insert XML chunks into an XML base structure to create the final XML output. import xml.etree.ElementTree as ET from xml.etree.ElementTree import XMLParser base_tree = ...
Enrra's user avatar
  • 69
1 vote
2 answers
84 views

Given XML file snippet is: <?xml version="1.0" standalone="yes"?> <event_configuration family="21" version="2"> <pqr subtype="abc"&...
NaviB's user avatar
  • 17

1
2 3 4 5
65