W3C home > Mailing lists > Public > www-amaya@w3.org > October to December 2002

XML 1.0 SE Conformance Error

From: Brant Langer Gurganus <brantgurganus2001@cherokeescouting.org>
Date: Sat, 21 Dec 2002 00:00:54 -0500
Message-ID: <3E03F586.5040908@cherokeescouting.org>
To: www-amaya@w3.org
Amaya has an XML parsing issue that causes it to not report an error 
that should be reported in order to be conformant

 From XML spec:
[Definition: *Validating processors* must, at user option, report 
violations of the constraints expressed by the declarations in the DTD 
<http://www.w3.org/TR/REC-xml#dt-doctype>, and failures to fulfill the 
validity constraints given in this specification.] To accomplish this, 
validating XML processors must read and process the entire DTD and all 
external parsed entities referenced in the document..

By that definition (if Amaya uses a validating XML processor), it must 
report if whitespace appears before the XML declaration.

[1]    |document|    ::=    |prolog 
<http://www.w3.org/TR/REC-xml#NT-prolog> element 
<http://www.w3.org/TR/REC-xml#NT-element> Misc 
<http://www.w3.org/TR/REC-xml#NT-Misc>*|

[22]    |prolog|    ::=    |XMLDecl 
<http://www.w3.org/TR/REC-xml#NT-XMLDecl>?Misc 
<http://www.w3.org/TR/REC-xml#NT-Misc>* (doctypedecl 
<http://www.w3.org/TR/REC-xml#NT-doctypedecl> Misc 
<http://www.w3.org/TR/REC-xml#NT-Misc>*)?|
[23]    |XMLDecl|    ::=    |'<?xml' VersionInfo 
<http://www.w3.org/TR/REC-xml#NT-VersionInfo> EncodingDecl 
<http://www.w3.org/TR/REC-xml#NT-EncodingDecl>? SDDecl 
<http://www.w3.org/TR/REC-xml#NT-SDDecl>? S 
<http://www.w3.org/TR/REC-xml#NT-S>? '?>'|

Notice that according to the above excerpts, there can be no whitespace before an XML declaration.

To reproduce:
1. Create an XHTML document.
2. Edit it in source view to add a space before <?xml.

Actual Results:
The document is parsed as if that constraint was not there.

Expected Results:
A message similar to the following should be given:
XML Parsing Error: xml processing instruction not at start of external entity
Location: file:///F:/Documents%20and%20Settings/Brant%20Gurganus/My%20Documents/Personal/brant.xhtml
Line Number 1, Column 2: <?xml version="1.0" encoding="UTF-8"?>
                       -^

Please not that the above sample is from Mozilla which is not a validating processor and by the definition of such is not required to check for this.
-- 
Brant Langer Gurganus
http://troop545.cjb.net/brant.xhtml


Received on Saturday, 21 December 2002 00:02:15 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 22:30:39 UTC