The link to the SVG spec in the comments points to SVG 2, but the types are based on SVG 1.1
The SVG types are said ( https://github.com/ocsigen/tyxml/blob/master/lib/svg_types.mli#L26 ) to be based on http://www.w3.org/TR/SVG/ I guess that this URL used to point to the specification of SVG 1.1, but it now points to SVG 2.
In the case of the definition of paint, the difference is large.
Here is what it appears in SVG 2 ( https://www.w3.org/TR/SVG/painting.html#SpecifyingPaint )
<paint> := none | <color> | <url> [none | <color>? | context-fill | context-stroke
And in SVG 1.1 ( https://www.w3.org/TR/SVG11/painting.html#SpecifyingPaint )
<paint> := none | currentColor | <color> [<icccolor>] | <funciri> [ none | currentColor | <color> [<icccolor>] ] | inherit
Here is what it appears in https://github.com/ocsigen/tyxml/blob/master/lib/svg_types.mli#L287
type color = string
type icccolor = string
type paint_whitout_icc =
[ `None | `CurrentColor
| `Color of (color * icccolor option)
]
type paint =
[ paint_whitout_icc
| `Icc of (iri * paint_whitout_icc option) ]
This implementation is close to the one of SVG 1.1, but it differs a lot from the SVG 2. This confused me as I tried to compare to make it match to SVG 2's concepts. I still feel that I'm missing the url(#gradient) value, but I'm not used to ICC so I might just have misunderstand.
It's completely fine to stay with SVG 1.1, but maybe it would be nice to help the reader accustomed to SVG 2:
- by replacing http://www.w3.org/TR/SVG/ by http://www.w3.org/TR/SVG11/
- possibly also by citing the appendix https://www.w3.org/TR/SVG/changes.html#color
- by adding some brief comments to the parts that significantly changed to understand the concept.
I would be quite in favour of a path moving to SVG2, but in absence of that, you are right, we should fix the documentation.