Answers for "xml file html"

6

xml vs html

The most salient difference between HTML and 
XML is that HTML describes presentation and XML describes content. 

An HTML document rendered in a web browser is human readable. 

XML is aimed toward being both human and machine readable.
Posted by: Guest on June-10-2020
0

how to read an xml file

import xmltodict as xtd
import os

xml_file_content = ""

catalog_dir = os.chdir('directory')
catalog_dir_array = os.listdir(catalog_dir)

if("nameOfFile.xml" in catalog_dir_array):
    catalog_file_content = open("nameOfFile.xml", "r").read()

catalog_file_content_dict = xtd.parse(catalog_file_content)
Posted by: Guest on September-15-2020

Browse Popular Code Answers by Language