Skip to main content

All Questions

Tagged with
0 votes
3 answers
111 views

Override encoding value in XML file

I am reading .xml files using the Python library xml.etree.ElementTree. My .xml file looks like this: <?xml version="1.0" encoding=""?> <Parent> <Field1>7933<...
lawrence's user avatar
0 votes
3 answers
95 views

Python requests POST method parses XML always as ANSI

I have a script which sends a XML within a POST method using python requests module to an API. This code works from my test machine (windows) when I deploy the script to my PROD server (Debian) I ...
Sven Sven's user avatar
1 vote
1 answer
932 views

Remove "encoding" attribute from XML in Python

I am using python to do some conditional changes to an XML document. The incoming document has <?xml version="1.0" ?> at the top. I'm using xml.etree.ElementTree. How I'm parsing the ...
Bryant Richards's user avatar
0 votes
1 answer
823 views

Hex Entity Encoding in SQLmap

I am using SQLmap and want to hex-entity-encode the input before SQLmap sends it to the server. For example, hex-entity-encoding of "abc" should return &#x61;&#x62;&#x63; I know ...
Trường An Tô Nguyễn's user avatar
0 votes
0 answers
393 views

encoding Lithuanian character in xml using python

I have a code: def convert_df_to_xml(df,fd,ld): # sukuriam pagrindini elementa (root) su pavadinimu Invoices. root = ET.Element("Invoices") root.set("from", str(fd)) root.set("...
Tomas Vaitkus's user avatar
0 votes
1 answer
73 views

Issues with encoding with ElementTree module using XML and Pandas dataframe

I am importing an xml file using ElementTree. I am attempting to append to this table element with the same row/cell format as below. <Table> <Column/> <Row ss:AutoFitHeight="...
Michael Harris's user avatar
1 vote
1 answer
388 views

Using lxml changes &#xA; to &#10; in a line for some reason

When using the following code one line in the file is being changed for some reason dpa_tree = etree.parse(dpaFile) dpa_root = dpa_tree.getroot() dpa_tree.write(dpaFile, encoding='UTF-8', ...
Twowolfs's user avatar
1 vote
0 answers
51 views

Why xml file 'text string' looks encoded after writing with python?

I tried to open XML with notepad, word-pad and notepad++ but it looks encoded into some kind of hashtag strings. But it shows actual data when open with almost any browser like edge, Firefox, explorer....
Code Logic's user avatar
0 votes
0 answers
31 views

Format error while opening XML file with Python - NULL (\x00) between characters [duplicate]

I'm working with XML files in Python. My goal is to extract information from specific fields in these files for later use. Apparently, these XML files are well-constructed, as I can open them with a ...
FranmR's user avatar
  • 76
0 votes
1 answer
634 views

Python, writing an XML file - 'charmap' codec can't encode character. When including encoding to fix, get must be str, not bytes

I have a program that is creating an XML file and writing it to the system. My issues occurs when I encounter characters like '\u1d52', the system throws the error. "charmap' codec can't encode ...
Mi-krater's user avatar
  • 629
0 votes
2 answers
208 views

python return xmlblock and remove encoding tag

I am trying to edit an xml file. The file i get, where the new information is stored, looks like this: <Symbols> <Symbol> <Name TaskPrio="1">...
user8775221's user avatar
1 vote
0 answers
253 views

Encoding error in LXML etree.iterparse() but not in etree.parse()

I am trying to parse a ~200MB XML file using LXML. I was stupidly doing etree.parse(xml_path), without any encoding parameter as argument, and then using iterwalk() to iterate over some child nodes, ...
Kevin Doshi's user avatar
2 votes
1 answer
3k views

Python xml.etree.ElementTree parse force encoding

I getting many XML files and some of them has wrong encoding (e.g. in xml header is ISO-8859-1, but all the strings are in UTF-8, and so on) For parsing is used xml.etree.ElementTree and this also ...
vlk's user avatar
  • 2,809
0 votes
1 answer
579 views

How to output CDATA using yattag library

I'm trying with the following code to generate an XML file contains tags </documents>. string = "dasdd Wonder asdf new single, “Tomorrow” #URL# | " \ "oiojk asfddsf releases new asdfdf, “...
Minions's user avatar
  • 5,497
0 votes
2 answers
458 views

BeautifulSoup parse XML with HTML content

I have an XML file (formally XBRL) in which some of the tags contain escaped HTML. I'd like to parse the document an XML, and then extract the HTML from these tags. However, it appears that the ...
user1315621's user avatar
  • 3,412

15 30 50 per page
1
2 3 4 5