Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for detecting invalid XML that has unsupported content before root element #184

Merged
merged 1 commit into from
Jul 22, 2024

Commits on Jul 22, 2024

  1. fix: Content at the start of the document

    ## Why?
    
    XML with content at the start of the document is invalid.
    
    https://www.w3.org/TR/2006/REC-xml11-20060816/#document
    
    ```
    [1]   document   ::=   ( prolog element Misc* ) - ( Char* RestrictedChar Char* )
    ```
    
    https://www.w3.org/TR/2006/REC-xml11-20060816/#NT-prolog
    
    ```
    [22]   	prolog	   ::=   	XMLDecl Misc* (doctypedecl Misc*)?
    ```
    
    https://www.w3.org/TR/2006/REC-xml11-20060816/#NT-XMLDecl
    ```
    [23]   	XMLDecl	   ::=   	'<?xml' VersionInfo EncodingDecl? SDDecl? S? '?>'
    ```
    
    https://www.w3.org/TR/2006/REC-xml11-20060816/#NT-Misc
    
    ```
    [27]   	Misc	   ::=   	Comment | PI | S
    ```
    
    https://www.w3.org/TR/2006/REC-xml11-20060816/#NT-PI
    
    ```
    [16]   	PI	   ::=   	'<?' PITarget (S (Char* - (Char* '?>' Char*)))? '?>'
    ```
    
    https://www.w3.org/TR/2006/REC-xml11-20060816/#NT-PITarget
    
    ```
    [17]   	PITarget	   ::=   	Name - (('X' | 'x') ('M' | 'm') ('L' | 'l'))
    ```
    
    https://www.w3.org/TR/2006/REC-xml11-20060816/#NT-doctypedecl
    ```
    [28]   	doctypedecl	   ::=   	'<!DOCTYPE' S Name (S ExternalID)? S? ('[' intSubset ']' S?)? '>'
    ```
    naitoh committed Jul 22, 2024
    Configuration menu
    Copy the full SHA
    5ebd293 View commit details
    Browse the repository at this point in the history