Python Forum
Remove Empty tags in XML using plain python without lxml library
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Remove Empty tags in XML using plain python without lxml library
#4
I believe that without using extra library like lxml etc., this requirement might not be possible, but as an implementation specialist i found a work-around for this.
You can replace your empty string with the 'NULL' keyword and then remove the line altogether where ever you find 'NULL' in the XML.
Reply


Messages In This Thread
RE: Remove Empty tags in XML using plain python without lxml library - by saurabhverma2412 - Aug-21-2018, 04:53 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Python script that deletes symbols in plain text nzcan 3 705 Sep-05-2023, 04:03 PM
Last Post: deanhystad
  Remove empty keys in a python list python_student 7 3,053 Jan-12-2022, 10:23 PM
Last Post: python_student
  Parsing link from html tags with Python Melcu54 0 1,622 Jun-14-2021, 09:25 AM
Last Post: Melcu54
  Loop through tags inside tags in Selenium/Python xpack24 1 5,694 Oct-23-2019, 10:15 AM
Last Post: Larz60+
  How to remove empty struct from matlab file in python? python_newbie09 0 2,392 Jun-25-2019, 12:13 PM
Last Post: python_newbie09
  remove tags from BeautifulSoup result moski 1 4,700 Jun-05-2019, 01:47 PM
Last Post: heiner55
  lxml - etree/lxml need help storing variable for most inserted element goeb 0 2,568 Apr-01-2019, 03:09 AM
Last Post: goeb
  How to remove empty line between two print functions BigEasy 1 2,387 Feb-07-2018, 08:38 AM
Last Post: buran
  lxml saves empty tags with None text urano1981 0 4,694 Oct-23-2017, 11:45 AM
Last Post: urano1981
  PyInstaller, how to create library folder instead of library.zip file ? harun2525 2 4,816 May-06-2017, 11:29 AM
Last Post: harun2525

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020