svg - 如何以 SVG 格式使用 xlink:href 传递参数?
问题描述
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN" "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:ev="http://www.w3.org/2001/xml-events"
xmlns:v="http://schemas.microsoft.com/visio/2003/SVGExtensions/" width="70.4094in" height="34.0787in"
viewBox="0 0 20000 10000" xml:space="preserve" color-interpolation-filters="sRGB" class="st238">
<defs>
<g id="text1">
<title> </title>
<v:textRect cx="0" cy="0" width="19.2" height="0"/>
<text x="0" y="0"> text to display </text>
</g>
</defs>
<g>
<use x="100" y="100" xlink:href="#text1"/>
<use x="200" y="200" xlink:href="#text1"/>
</g>
</svg>
在我的代码中,我在 use 和 xlink 中使用了同一个对象两次,你知道我如何通过 xlink 传递参数(例如文本的参数而不是显示“要显示的文本”)吗?
解决方案
推荐阅读
- python - 如何将以下 Python 字符串拆分为字符串列表?
- clojure - 如何在环中发送输入流作为响应?
- r - 尝试根据 if_else 条件更改变量值时 mutate() 出现 dplyr 错误
- lua - 加分在 Roblox 中不断增加
- python-3.x - 将列表中的结果附加到字符串
- c++ - 将数组传递给 void 参数中的回调函数
- ruby-on-rails - ActiveRecord::StatementInvalid: SQLite3::SQLException: 没有这样的表
- c++ - 遍历同一数组的多个范围
- python - 如何使用 Angular 仅选择第一个元素?“Django 后端”
- python - 如何将python项目(pycharm)转换为exe文件