Skip to content

Conversation

@Holzhaus
Copy link

XML declarations are not processing instructions.
This fixes #174.

According to XML 1.0 (5th Edition), Section 2.6, the PI target names "xml",
"XML" and so on are reserved.

Production Rule 17 states:

PITarget ::= Name - (('X' | 'x') ('M' | 'm') ('L' | 'l'))

sax.js Outdated
var end = source.indexOf('?>',start);
if(end){
var match = source.substring(start,end).match(/^<\?(\S*)\s*([\s\S]*?)\s*$/);
var match = source.substring(start,end).match(/^<\?(\S+)\s*([\s\S]*?)\s*$/);
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is another fix that slipped in: The target name of a PI mustn't be empty.

The XML declaration is not a processing instruction.

According to XML 1.0 (5th Edition), Section 2.6, the PI target names "xml",
"XML" and so on are reserved.

Production Rule 17 states:
> PITarget ::= Name - (('X' | 'x') ('M' | 'm') ('L' | 'l'))

This fixes jindw#174.
@CodyReichert
Copy link

Just hit this myself.

Anything I can do to help get this one merged? The test cases look correct, but let me know if I can help get it ready for release.

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.

XML Declaration is not a Processing Instruction

2 participants