我能够将 svg 文件导入 visio。我想将自定义数据附加到 SVG 文件中的元素,以便导入时数据将显示在 visio 绘图中元素的形状数据中。我知道我可以在事后将此数据分配给绘图,但我希望将其与文件一起导入。
附加:如果我添加形状数据然后导出到 svg,则数据的外观为
<v:custProps>
<v:cp v:nameU="this_is_data_name" v:lbl="this_is_data_label" v:type="0" v:langID="1033"
v:val="VT4(this is data value)"/>
</v:custProps>
这些 custProps 是我想要通过 SVG 导入的数据。我可以导入这些数据/如何导入吗?
最佳答案
@ccprog 评论让我朝着正确的方向前进,但还有更多内容需要补充。所需的正确命名空间是
xmlns:v="http://schemas.microsoft.com/visio/2003/SVGExtensions/"
此外,我需要将该元素包装在 g 元素中。最终产品如下:
<g id="shape3" v:mID="3" v:groupContext="shape">
<v:custProps>
<v:cp v:nameU="Row_1" v:lbl="data1" v:type="0" v:langID="1033" v:val="VT4(data value 1)" />
<v:cp v:nameU="Row_2" v:lbl="data2" v:type="0" v:langID="1033" v:val="VT4(data value 2)" />
</v:custProps>
<rect x="595" y="40" fill="white" width="45" height="33" />
</g>
关于svg - Visio 导入 SVG 自定义形状数据,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64827601/