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

Clarify that SVG does not need to be valid XML #960

Open
real-or-random opened this issue Jan 2, 2025 · 0 comments
Open

Clarify that SVG does not need to be valid XML #960

real-or-random opened this issue Jan 2, 2025 · 0 comments

Comments

@real-or-random
Copy link

The conformance section says:
"Additional conformance classes depend on whether the content is also valid and well-formed XML":

svgwg/master/conform.html

Lines 550 to 551 in 51ff4ba

Additional conformance classes depend on whether the content
is also valid and well-formed XML [<a href="refs.html#ref-xml">xml</a>].

I think it should say:
"Additional conformance classes depend on whether the content is also well-formed XML".

None of the conformance classes require that the document is valid XML. (The only requirement that seems to be "imported" from XML is the validity of the id attribute.)

Moreover, none of the examples in the entire spec contain a <!DOCTYPE svg> declaration which would be required to be valid XML 1.0. (See XML 1.0 Section 2.8 "Prolog and Document Type Declaration", which says "The document type declaration MUST appear before the first element in the document.")

In general, I think it will be helpful to explain in more natural language that:

  • SVG does not need to be valid XML. (Since SVG is defined in terms of XML, readers could reasonably expect that valid XML is required)
  • A DOCTYPE declaration is not necessary nor recommended. (This was removed in 96e5189 for some reason.)
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

No branches or pull requests

1 participant