<p dir="ltr">What your describe is exactly a vendor-specific proprietary user agent extension.</p>
<p dir="ltr">data-* would be inappropriate as that is for authors.</p>
<p dir="ltr">I think my recommendation would be to have one private format for editing that has this information (could just be XML), and then export to HTML without this information.</p>
<br><div class="gmail_quote"><div dir="ltr">On Sun, Feb 28, 2016, 08:42 Jarek Foksa <<a href="mailto:jarek@boxy-svg.com">jarek@boxy-svg.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I'm building an SVG editor that allows users to save SVG documents using either XML or HTML 5 serialization.<br>
<br>
In order to preserve editing capabilities I need to store app-specific data as content attributes. For example, when user draws a star path, I want to preserve the information about the number of arms, the inner radius and the outer radius of the star.<br>
<br>
When using XML serialization, the obvious solution is to use custom namespace:<br>
<br>
  <svg viewBox="0 0 500 500" xmlns="<a href="http://www.w3.org/2000/svg" rel="noreferrer" target="_blank">http://www.w3.org/2000/svg</a>" xmlns:bx="<a href="http://www.boxy-svg.com/bx" rel="noreferrer" target="_blank">http://www.boxy-svg.com/bx</a>"><br>
    <path bx:shape="star" bx:arms="6" bx:r1="10" bx:r2="20" d="..."><br>
  </svg><br>
<br>
However, I'n not sure how the corresponding markup should look like when using HTML 5 serialization. Should I use data-* attributes?<br>
<br>
  <svg viewBox="0 0 500 500"><br>
    <path data-shape="star" data-arms="6" data-r1="10" data-r2="20" d="..."><br>
  </svg><br>
<br>
... or data-vendor-* attributes?<br>
<br>
  <svg viewBox="0 0 500 500"><br>
    <path data-bx-shape="star" data-bx-arms="6" data-bx-r1="10" data-bx-r2="20" d="..."><br>
  </svg><br>
<br>
... or x-vendor-* attributes?<br>
<br>
  <svg viewBox="0 0 500 500"><br>
    <path x-bx-shape="star" x-bx-arms="6" x-bx-r1="10" x-bx-r2="20" d="..."><br>
  </svg><br>
<br>
The data-* approach is very likely going to cause clashes when the file is opened with another editor.<br>
<br>
The data-vendor-* approach does not seem to be mentioned in the spec.<br>
<br>
The x-vendor-* approach seems to be what the HTML spec recommends, but I'm not entirely sure whether my usage falls under the category of "vendor-specific proprietary user agent extension". Also, the x-vendor-* attributes are not mentioned in the current SVG 2 draft.<br>
<br>
_______________________________________________<br>
Implementors mailing list<br>
<a href="mailto:Implementors@lists.whatwg.org" target="_blank">Implementors@lists.whatwg.org</a><br>
<a href="http://lists.whatwg.org/listinfo.cgi/implementors-whatwg.org" rel="noreferrer" target="_blank">http://lists.whatwg.org/listinfo.cgi/implementors-whatwg.org</a><br>
</blockquote></div>