git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: XML Parsing Error: junk after document element

From
Jakub Narebski <jnareb@gmail.com>
Date
Feb 11, 2010, 11:01 UTC
Message-ID
<m3ocjw82ai.fsf@localhost.localdomain>
In-Reply-To
<b713df2c1002102347g70cc212et21d507d44bb5aead@mail.gmail.com>
Siju George <sgeorge.ml@gmail.com> writes:
Show 11 quoted lines
> Hi,
> 
> I get this error when I take gitweb in a browser.
> 
> XML Parsing Error: junk after document element
> Location: http://172.16.3.27/cgi-bin/gitweb.cgi
> Line Number 28, Column 8:</html><!DOCTYPE HTML PUBLIC "-//IETF//DTD
> HTML 2.0//EN">
> -------^
> 
> How can I solve it?

Which version of gitweb?[1] Which version of git?[2] What web server? Which version of CGI.pm is used by web server?[3]

The included fragment after closing '</html>' tag doesn't look like something coming from gitweb, as gitweb uses XHTML 1.0 DTD since it's first version.

Try to view source, or use different web browser that doesn't do strict XML validation to find the source of this error.

If everything else fals, you can always edit gitweb.cgi to comment out content-type negotiation, to always serve as text/html mimetype - which should torn off XML validation, as below:

	my $content_type;
	# require explicit support from the UA if we are to send the page as
	# 'application/xhtml+xml', otherwise send it as plain old 'text/html'.
	# we have to do this because MSIE sometimes globs '*/*', pretending to
	# support xhtml+xml but choking when it gets what it asked for.
	# Disable content-type negotiation when caching (use mimetype good for all).
	#if (defined $cgi->http('HTTP_ACCEPT') &&
	#    $cgi->http('HTTP_ACCEPT') =~ m/(,|;|\s|^)application\/xhtml\+xml(,|;|\s|$)/ &&
	#    $cgi->Accept('application/xhtml+xml') != 0) {
	#	$content_type = 'application/xhtml+xml';
	#} else {
		$content_type = 'text/html';
	#}

The commands below are _examples_ only: [1] grep -F 'our $version' /var/www/cgi-bin/gitweb.cgi [2] git --version [3] perl -MCGI -le 'print $CGI::VERSION'

-- 
Jakub Narebski
Poland
ShadeHawk on #git
Previous: Siju GeorgeNext: Siju George
Message 2 of 5 in “XML Parsing Error: junk after document element”
  1. Siju GeorgeFeb 11, 2010
  2. Jakub NarebskiFeb 11, 2010
  3. Siju GeorgeFeb 12, 2010
  4. Jakub NarebskiFeb 12, 2010
  5. Siju GeorgeFeb 17, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.