Skip to content

Conversation

naitoh
Copy link
Contributor

@naitoh naitoh commented Jul 6, 2024

Why?

XML declaration must be the first item.

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? '?>'

See: #161 (comment)

## Why?
XML declaration must be the first item.

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? '?>'
```

See: ruby#161 (comment)
@naitoh naitoh force-pushed the add_position_check_for_xml_declaration branch from 34ea778 to 53dd46c Compare July 7, 2024 00:58
@naitoh naitoh requested a review from kou July 7, 2024 01:04
@kou kou merged commit ebc3e85 into ruby:master Jul 7, 2024
@kou
Copy link
Member

kou commented Jul 7, 2024

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants