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

"well-formed HTML document"? #1799

Open
meiqinyan opened this issue Feb 13, 2025 · 1 comment
Open

"well-formed HTML document"? #1799

meiqinyan opened this issue Feb 13, 2025 · 1 comment
Assignees
Labels
Bug Something that doesn't work in the current specification Editorial Minor typos, wording clarifications, example fixes, etc. XQFO An issue related to Functions and Operators

Comments

@meiqinyan
Copy link

There is an apparent ambiguity in the XPath Functions specification as to whether fn:parse-html raises dynamic error err:FODC0011 when html-version is set to one of the HTML5 versions and the content of $html is not well-formed, given the general expectation that HTML5 parsers can always parse an input string regardless of syntactic validity.

The HTML5 standard, for its part, has actually always allowed the parser to be aborted upon encountering a parse error (though no browser does this), so the function definition would seem to require that parse-html("<p>Hello</p>", { "method": "html", "html-version": 5 }) invariably raises an error, given that the input is invalid (missing opening <html> tag, etc.).

I don't think this is the intended behavior; my suggestion is to either have it be explicitly implementation-defined as to which parse errors cause err:FODC0011 to be raised, or require that it is never raised for HTML5.

@meiqinyan
Copy link
Author

There is also the question of invalid (but parseable) HTML5 constructs that are incoherent with XML, such as the use of < and : in tag and attribute names.

@ChristianGruen ChristianGruen added Bug Something that doesn't work in the current specification XQFO An issue related to Functions and Operators Editorial Minor typos, wording clarifications, example fixes, etc. labels Feb 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something that doesn't work in the current specification Editorial Minor typos, wording clarifications, example fixes, etc. XQFO An issue related to Functions and Operators
Projects
None yet
Development

No branches or pull requests

3 participants