writing HTML back to file
Header for my input file looks like:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
After doing certain changes in document using lxml.html parser, i need to save the changes in a file. while doing so Header of the file changes to:
<!DOCTYPE html PUBLIC开发者_开发百科 "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<?xml version="1.0" encoding="UTF-8"??>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" xml:lang="en">
i am not sure why is this happening, may be its too silly but i am stuck here. please help!!
Maybe parser caters to the IE6's Quirks mode triggering?
精彩评论