DTD
W3C · 1.1
SVG 1.1
SVG images checked against the SVG 1.1 DTD: elements, attributes and nesting.
About
The SVG 1.1 DTD is the only schema W3C published for SVG. It is strict: attributes from other namespaces (such as Inkscape's or Sketch's) and SVG 2 features are reported, which is useful to clean files for older renderers and print workflows.
This entry uses the flattened, single-file form of the DTD.
Good to know
- libxml2 warns that the DTD declares the xml:space attribute of style twice; the warning comes from the DTD itself and can be ignored.
- Browsers render SVG 2 and many non-standard attributes that this DTD reports; an error here does not mean a browser will fail to show the image.
- The example is by xmlvalid.com.
Example document
logo.svg · 435 B · valid against this schema
In CI and from code
The same schema by its name, svg-1.1, through the API.
npx @xmlvalid/cli validate "**/*.xml" --schema svg-1.1
- uses: xmlvalid/validate-action@v1
with:
files: "**/*.xml"
schema: svg-1.1
api-key: ${{ secrets.XMLVALID_API_KEY }}
curl https://xmlvalid.com/api/v1/validations \
-H "Authorization: Bearer $XMLVALID_API_KEY" \
-F document={{ $schema->example ?? 'document.xml' }} -F schema=svg-1.1
Free accounts get 100 API validations a month. On Pro, a URL monitor can check a published document against this schema every hour and email you when it breaks. More CI setups