Repository navigation
test: Fix invalid XML with spaces before the XML declaration - #115
Conversation
|
Good catch! But the important part in the specification is difference. The part you cited explains about an element (e.g. https://www.w3.org/TR/2006/REC-xml11-20060816/#document
It doesn't have https://www.w3.org/TR/2006/REC-xml11-20060816/#NT-prolog
It doesn't have https://www.w3.org/TR/2006/REC-xml11-20060816/#NT-XMLDecl
It doesn't have Could you update the PR description? |
[Why] XML declaration allowed only at the start of the document. https://www.w3.org/TR/2006/REC-xml11-20060816/#document ``` [1] document ::= ( prolog element Misc* ) - ( Char* RestrictedChar Char* ) ``` It doesn't have `S*` before `prolog`. https://www.w3.org/TR/2006/REC-xml11-20060816/#NT-prolog ``` [22] prolog ::= XMLDecl Misc* (doctypedecl Misc*)? ``` It doesn't have `S*` before `XMLdecl`. https://www.w3.org/TR/2006/REC-xml11-20060816/#NT-XMLDecl ``` [23] XMLDecl ::= '<?xml' VersionInfo EncodingDecl? SDDecl? S? '?>' ``` It doesn't have `S*` before `'<?xml'`.
49a6fa4 to
50a91a6
Compare
|
@kou |
|
Thanks! |
Why?
XML declaration allowed only at the start of the document.
https://www.w3.org/TR/2006/REC-xml11-20060816/#document
It doesn't have
S*beforeprolog.https://www.w3.org/TR/2006/REC-xml11-20060816/#NT-prolog
It doesn't have
S*beforeXMLdecl.https://www.w3.org/TR/2006/REC-xml11-20060816/#NT-XMLDecl
It doesn't have
S*before'<?xml'.