Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/node.js/41.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何将SVG元素附加到现有的SVG文件Node.js中?_Node.js_Svg - Fatal编程技术网

如何将SVG元素附加到现有的SVG文件Node.js中?

如何将SVG元素附加到现有的SVG文件Node.js中?,node.js,svg,Node.js,Svg,我的svg文件如下,它生成一个简单的矩形 simple.svg 笔记 技术/编程-Node.js 我怎样才能做到这一点? Node.js中是否有可用的Svg解析器 提前谢谢 您不需要SVG解析器。任何XML解析器都应该这样做,而且有很多。。如何使用Xml2js解析器编写或添加?这可能会有所帮助: <g id="seat"> <rect x="130" y= "130" height="320" width="550" id="rect1" fill ="whi

我的svg文件如下,它生成一个简单的矩形

simple.svg

笔记 技术/编程-Node.js

我怎样才能做到这一点? Node.js中是否有可用的Svg解析器


提前谢谢

您不需要SVG解析器。任何XML解析器都应该这样做,而且有很多。。如何使用Xml2js解析器编写或添加?这可能会有所帮助:
  <g id="seat">
       <rect x="130" y= "130" height="320" width="550" id="rect1" fill ="white" stroke="blue" ></rect>
  </g>
 <circle style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0); stroke-miterlimit: 0.486;" cx="88" cy="84" r="5" fill="#ffffff" stroke="#000000" stroke-miterlimit="0.486" stroke-width="0.35" id="A_8_05"/>