问题描述
<?xmlversion="1.0"encoding="UTF-8"standalone="no"?><!DOCTYPEsvgPUBLIC"-//W3C//DTDSVG1.0//EN""http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd"><!--由MicrosoftVisio2003,SVGExport,v1.0生成example3.svgPage-1--><svgxmlns="http://www.w3.org/2000/svg"xmlns:v="http://schemas.microsoft.com/visio/2003/SVGExtensions/"width="16.5354in"height="11.6929in"viewBox="001190.55841.89"xml:space="preserve"color-interpolation-filters="sRGB"class="st10"onload="init(evt)"onclick="showCurColor(evt)"><v:documentPropertiesv:langID="2052"v:viewMarkup="false"/><styletype="text/css"><![CDATA[.st1{fill:#0000ff;stroke:#000000;stroke-linecap:round;stroke-linejoin:round;stroke-width:0.24}.st2{fill:#000000;font-family:宋体;font-size:0.833336em;font-weight:bold}.st3{font-size:1em}.st4{fill:#00ff00;stroke:#000000;stroke-linecap:round;stroke-linejoin:round;stroke-width:0.24}.st5{fill:#000000;font-family:宋体;font-size:0.666664em;font-weight:bold}.st6{fill:#ffff00;stroke:#000000;stroke-linecap:round;stroke-linejoin:round;stroke-width:0.24}.st7{fill:#ff0000;stroke:#000000;stroke-linecap:round;stroke-linejoin:round;stroke-width:0.24}.st8{fill:#800080;stroke:#000000;stroke-linecap:round;stroke-linejoin:round;stroke-width:0.24}.st9{stroke:#4677bf;stroke-linecap:round;stroke-linejoin:round;stroke-width:0.24}.st10{fill:none;fill-rule:evenodd;font-size:12;overflow:visible;stroke-linecap:square;stroke-miterlimit:3}]]></style><scripttype="application/javascript"><![CDATA[varsvgDoc=null;varsvgRoot=null;varparentWnd=null;//初始化functioninit(evt){parentWnd=window.parent;//获得引用svg文件的父窗口if(parentWnd.document.title==null||parentWnd.document.title==''){alert("请不要直接在浏览器中打开‘svg’文档!");//下面的代码作用是不提示确认关闭窗口parentWnd.opener=null;parentWnd.open('','_self');parentWnd.close();}}//显示当前矩形框颜色functionshowCurColor(evt){vardesc;vartarget=evt.target;//获得当前点击的对象//vardesc=evt.getTarget();//获得当前点击的对象//if(target.id=="shape2-5")//点击到的是矩形框//if(target.desc=="留学生A座计算机")//点击到的是矩形框{//varrectStyle=target.style;//parentWnd.setCurColor(rectStyle.fill);//调用父窗口里面的设置颜色文本的方法//vardesc=target.id;desc=target.getAttribute("id");//alert(desc);parentWnd.sss(desc);//调用html中的js函数}}]]></script><gv:mID="0"v:index="1"v:groupContext="foregroundPage"><v:userDefs><v:udv:nameU="SchemeName"v:val="VT4(Default)"/></v:userDefs><title>Page-1</title><v:pagePropertiesv:drawingScale="0.0393701"v:pageScale="0.0393701"v:drawingUnits="24"v:shadowOffsetX="8.50394"v:shadowOffsetY="-8.50394"v:shadowType="1"/><v:layerv:name="连接线"v:index="0"/><gid="shape1-1"v:mID="1"v:groupContext="shape"transform="translate(191.339,-751.181)"><title>Ellipse</title><desc>留学生A座计算机</desc><v:userDefs><v:udv:nameU="visVersion"v:val="VT0(11):26"/></v:userDefs><v:textBlockv:margins="rect(4,4,4,4)"v:tabSpace="42.5197"/><v:textRectcx="63.7795"cy="799.37"width="111.62"height="74.4094"/><pathid="留学生A座计算机"d="M0799.37A63.779542.5197011127.56799.37A63.779542.51970110799.37Z"class="st1"/><textx="26.12"y="802.37"class="st2"v:langID="2052"><v:paragraphv:horizAlign="1"/><v:tabList/>留学生<tspanclass="st3"v:langID="1033">A</tspan>座计算机</text></g><gid="shape2-5"v:mID="2"v:groupContext="shape"transform="translate(7.08661,-538.583)"><title>Circle</title><desc>留学生A座控制器一</desc><v:userDefs><v:udv:nameU="visVersion"v:val="VT0(11):26"/></v:userDefs><v:textBlockv:margins="rect(4,4,4,4)"v:tabSpace="42.5197"/><v:textRectcx="42.5197"cy="799.37"width="74.41"height="63.7795"/><pathid="留学生A座控制器一"d="M0799.37A42.519742.519701185.04799.37A42.519742.51970010799.37Z"class="st4"/><textx="12.39"y="796.97"class="st5"v:langID="2052"><v:paragraphv:horizAlign="1"/><v:tabList/>留学生<tspanclass="st3"v:langID="1033">A</tspan>座控制器<tspanx="38.5"dy="1.2em"class="st3">一</tspan></text></g><gid="shape3-10"v:mID="3"v:groupContext="shape"transform="translate(276.378,-538.583)"><title>Circle.3</title><desc>留学生A座控制器二</desc><v:userDefs><v:udv:nameU="visVersion"v:val="VT0(11):26"/></v:userDefs><v:textBlockv:margins="rect(4,4,4,4)"v:tabSpace="42.5197"/><v:textRectcx="42.5197"cy="799.37"width="74.41"height="63.7795"/><pathid="留学生A座控制器二"d="M0799.37A42.519742.519701185.04799.37A42.519742.51970010799.37Z"class="st6"/><textx="12.39"y="796.97"class="st5"v:langID="2052"><v:paragraphv:horizAlign="1"/><v:tabList/>留学生<tspanclass="st3"v:langID="1033">A</tspan>座控制器<tspanx="38.5"dy="1.2em"class="st3">二</tspan></text></g><gid="shape4-15"v:mID="4"v:groupContext="shape"transform="translate(134.646,-545.669)"><title>Square</title><desc>留学生A座摄像头一</desc><v:userDefs><v:udv:nameU="visVersion"v:val="VT0(11):26"/></v:userDefs><v:textBlockv:margins="rect(4,4,4,4)"v:tabSpace="42.5197"/><v:textRectcx="35.4331"cy="806.457"width="70.87"height="70.8661"/><rectid="留学生A座摄像头一"x="0"y="771.024"width="70.8661"height="70.8661"class="st7"/><textx="5.3"y="804.06"class="st5"v:langID="2052"><v:paragraphv:horizAlign="1"/><v:tabList/>留学生<tspanclass="st3"v:langID="1033">A</tspan>座摄像头<tspanx="31.41"dy="1.2em"class="st3">一</tspan></text></g><gid="shape5-20"v:mID="5"v:groupContext="shape"transform="translate(425.197,-538.583)"><title>Square.5</title><desc>留学生A座摄像头二</desc><v:userDefs><v:udv:nameU="visVersion"v:val="VT0(11):26"/></v:userDefs><v:textBlockv:margins="rect(4,4,4,4)"v:tabSpace="42.5197"/><v:textRectcx="35.4331"cy="806.457"width="70.87"height="70.8661"/><rectid="留学生A座摄像头二"x="0"y="771.024"width="70.8661"height="70.8661"class="st8"/><textx="5.3"y="804.06"class="st5"v:langID="2052"><v:paragraphv:horizAlign="1"/><v:tabList/>留学生<tspanclass="st3"v:langID="1033">A</tspan>座摄像头<tspanx="31.41"dy="1.2em"class="st3">二</tspan></text></g><gid="shape6-25"v:mID="6"v:groupContext="shape"v:layerMember="0"transform="translate(49.6063,-623.622)"><title>Dynamicconnector</title><v:userDefs><v:udv:nameU="visVersion"v:val="VT0(11):26"/></v:userDefs><pathd="M0841.89L-0772.8L85.04772.8L85.04742.68L205.51742.68L205.51714.33"class="st9"/></g><gid="shape7-28"v:mID="7"v:groupContext="shape"v:layerMember="0"transform="translate(255.118,-751.181)"><title>动态连接线.7</title><v:userDefs><v:udv:nameU="visVersion"v:val="VT0(11):26"/></v:userDefs><pathd="M0841.89L0976.54L-49.61976.54"class="st9"/></g><gid="shape8-31"v:mID="8"v:groupContext="shape"v:layerMember="0"transform="translate(255.118,-751.181)"><title>动态连接线.8</title><v:userDefs><v:udv:nameU="visVersion"v:val="VT0(11):26"/></v:userDefs><pathd="M0841.89L0861.73L11.1861.73A2.36222.362200115.83861.73L49.61861.73L49.61969.45L63.78969.45"class="st9"/></g><gid="shape9-34"v:mID="9"v:groupContext="shape"v:layerMember="0"transform="translate(255.118,-751.181)"><title>动态连接线.9</title><v:userDefs><v:udv:nameU="visVersion"v:val="VT0(11):26"/></v:userDefs><pathd="M0841.89L0852.52L13.46852.52L13.46912.76L47.24912.76A2.36222.362200151.97912.76L185.67912.76L185.67965.91L240.94965.91L240.94983.62"class="st9"/></g><gid="shape10-37"v:mID="10"v:groupContext="shape"transform="translate(276.378,-354.331)"><title>Ellipse.10</title><desc>本部10#计算机</desc><v:userDefs><v:udv:nameU="visVersion"v:val="VT0(11):26"/></v:userDefs><v:textBlockv:margins="rect(4,4,4,4)"v:tabSpace="42.5197"/><v:textRectcx="63.7795"cy="799.37"width="111.62"height="74.4094"/><pathid="本部10#计算机"d="M0799.37A63.779542.5197011127.56799.37A63.779542.51970110799.37Z"class="st1"/><textx="31.12"y="802.37"class="st2"v:langID="2052"><v:paragraphv:horizAlign="1"/><v:tabList/>本部10#计算机</text></g><gid="shape11-40"v:mID="11"v:groupContext="shape"transform="translate(92.126,-141.732)"><title>Circle.11</title><desc>本部10#控制器一</desc><v:userDefs><v:udv:nameU="visVersion"v:val="VT0(11):26"/></v:userDefs><v:textBlockv:margins="rect(4,4,4,4)"v:tabSpace="42.5197"/><v:textRectcx="42.5197"cy="799.37"width="74.41"height="63.7795"/><pathid="本部10#控制器一"d="M0799.37A42.519742.519701185.04799.37A42.519742.51970010799.37Z"class="st4"/><textx="12.37"y="801.77"class="st5"v:langID="2052"><v:paragraphv:horizAlign="1"/><v:tabList/>本部10#控制器一</text></g><gid="shape12-43"v:mID="12"v:groupContext="shape"transform="translate(361.417,-141.732)"><title>Circle.12</title><desc>本部10#控制器二</desc><v:userDefs><v:udv:nameU="visVersion"v:val="VT0(11):26"/></v:userDefs><v:textBlockv:margins="rect(4,4,4,4)"v:tabSpace="42.5197"/><v:textRectcx="42.5197"cy="799.37"width="74.41"height="63.7795"/><pathid="本部10#控制器二"d="M0799.37A42.519742.519701185.04799.37A42.519742.51970010799.37Z"class="st6"/><textx="12.37"y="801.77"class="st5"v:langID="2052"><v:paragraphv:horizAlign="1"/><v:tabList/>本部10#控制器二</text></g></g></svg>如何利用XML技术读取修改SVG格式的文档呢,提示有未定义类型,如何定义呢,这个SVG是从VISIO制图中转换过来的SVG图形,我想为每个元素的desc(有用的元素,才有desc)添加一个id并且id=desc的内容,如何才能办得到呢
解决方案
解决方案二:
怎么没有人回答请问LZ的这个程序是怎么实现的???本人菜鸟有个期末设计就是这题用C++编写请大神救救