This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 12 - XML Parser does not detect whitespace before XML Decl.
Summary: XML Parser does not detect whitespace before XML Decl.
Status: RESOLVED FIXED
Alias: None
Product: Validator
Classification: Unclassified
Component: Parser (show other bugs)
Version: 0.6.0b1
Hardware: All All
: P3 major
Target Milestone: 1.0
Assignee: Terje Bless
QA Contact: qa-dev tracking
URL: http://www.bjoernsworld.de/temp/chars...
Whiteboard:
Keywords:
: 2785 (view as bug list)
Depends on:
Blocks: ceramio
  Show dependency treegraph
 
Reported: 2002-10-24 21:51 UTC by Terje Bless
Modified: 2016-05-18 18:46 UTC (History)
3 users (show)

See Also:


Attachments
invalid whitespace before xml declaration (288 bytes, application/xhtml+xml)
2006-08-30 02:20 UTC, Olivier Thereaux
Details

Description Terje Bless 2002-10-24 21:51:00 UTC
Reported by Björn Höhrmann:

  http://www.bjoernsworld.de/temp/chars-before-xmldecl.html is 

  [...]

  <?xml version='1.0' encoding='iso-8859-1'?>
  <!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">
    <head>
      <title>...</title>
    </head>
  
    <body>
      <p>...</p>
    </body>
  </html>
  [...]

That's an invalid XHTML 1.0 Strict document (note the
CRLF preceding the XML declaration). Now the HTML Validator
<URL:http://validator.w3.org:8001/check?uri=http%3A%2F%2Fwww.
bjoernsworld.de%2Ftemp%2Fchars-before-xmldecl.html> says it's
valid. That's bad. The Site Valet XML Validator finds the error
<URL:http://valet.webthing.com:8000/xmltest/val.so?
url=http%3A%2F%2Fwww.bjoernsworld.de%2Ftemp%2Fchars-before-xmldecl.html>
Comment 1 Terje Bless 2002-10-25 03:01:06 UTC
This is a known issue with OpenSP and SP. For some reason they do not detect
whitespace before the XML Declaration -- or at least do not report it -- and
according to Arjun Ray it's "impossible" for them to do it. I'm afraid my C++-fu
is a bit too weak to figure out exactly what's going on.
Comment 2 Brant Langer Gurganus 2003-02-21 16:12:24 UTC
If it is of any use, Mozilla seems to give a well-formed error with this.  Since
it is open-source, perhaps you can investigate how it detects the issue.
Comment 3 murali 2006-01-06 08:26:37 UTC
xx
Comment 4 murali 2006-01-06 08:33:55 UTC
*** Bug 14 has been marked as a duplicate of this bug. ***
Comment 5 Bj 2006-01-31 00:46:25 UTC
*** Bug 2785 has been marked as a duplicate of this bug. ***
Comment 6 Maciej Jaros 2006-01-31 01:33:58 UTC
I just want to add that since CSS validator detects incorrect placing of
"<?xml...?>" then maybe the validator for XHTML should borrow some of it's code ;).
Comment 7 Olivier Thereaux 2006-08-30 02:20:35 UTC
Created attachment 438 [details]
invalid whitespace before xml declaration

saved from http://www.bjoernsworld.de/temp/chars-before-xmldecl.html
Comment 8 Olivier Thereaux 2007-05-24 05:06:27 UTC
our using XML::LibXML in 0.8.0 (currently beta) takes care of this issue.