作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我想从xml文件中读取一些数据,并将这些数据嵌入到R脚本中,以便生成散点图。但是,问题是一个标签具有多个属性,
我不知道该如何处理。
请你能帮我吗?
例如,在下面的xml文件中,我想读取VertexConnectivity2的所有结果。也许我的其他问题和答案可以给您提示。
<?xml version="1.0" encoding="UTF-8"?>
<MappingTest xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://sourceforge.net/projects/alevin/ ./Alevin.xsd" xmlns="http://sourceforge.net/projects/alevin/" name="AdvSubgraphTestGenerator2">
<TestGenerator className="tests.generatorTests.AdvSubgraphTestRunner"/>
<ScenarioResult>
<ScenarioParameter name="Waxman_alpha" value="0.4"/>
<ScenarioParameter name="Waxman_beta" value="0.5"/>
<ScenarioParameter name="NumVNodesPerNet" value="7.0"/>
<ScenarioParameter name="NumVNets" value="1.0"/>
<ScenarioParameter name="SNetSize" value="100.0"/>
<ScenarioParameter name="Min_BW_Dem" value="10.0"/>
<ScenarioParameter name="Max_BW_Dem" value="50.0"/>
<ScenarioParameter name="Min_BW_Res" value="30.0"/>
<ScenarioParameter name="Max_BW_Res" value="100.0"/>
<ScenarioParameter name="Min_CPU_Dem" value="10.0"/>
<ScenarioParameter name="Max_CPU_Dem" value="50.0"/>
<ScenarioParameter name="Min_CPU_Res" value="30.0"/>
<ScenarioParameter name="Max_CPU_Res" value="100.0"/>
<ScenarioParameter name="NumberOfRun" value="1.0"/>
<ScenarioMetric name="Runtime" result="1612.0"/>
<ScenarioMetric name="RejectedNetworksNumber" result="0.0"/>
<ScenarioMetric name="VertexConnectivity2" result="1.0"/>
<ScenarioMetric name="AlgebraicConnectivity2" result="1.6851389854194017"/>
<ScenarioMetric name="EdgeConnectivity2" result="1.0"/>
<ScenarioMetric name="FabianianCoefficient2" result="1.0"/>
<ScenarioMetric name="SpectralGap2" result="0.9861088559313271"/>
<ScenarioMetric name="StochasticMetric2" result="0.7559889069056674"/>
<ScenarioMetric name="VertexConnectivity0" result="1.0"/>
<ScenarioMetric name="AlgebraicConnectivity0" result="0.6648338346749284"/>
<ScenarioMetric name="EdgeConnectivity0" result="1.0"/>
<ScenarioMetric name="FabianianCoefficient0" result="1.0"/>
<ScenarioMetric name="SpectralGap0" result="2.279045304613785"/>
<ScenarioMetric name="StochasticMetric0" result="0.4505067333055669"/>
</ScenarioResult>
<ScenarioResult>
<ScenarioParameter name="Waxman_alpha" value="0.4"/>
<ScenarioParameter name="Waxman_beta" value="0.5"/>
<ScenarioParameter name="NumVNodesPerNet" value="8.0"/>
<ScenarioParameter name="NumVNets" value="1.0"/>
<ScenarioParameter name="SNetSize" value="100.0"/>
<ScenarioParameter name="Min_BW_Dem" value="10.0"/>
<ScenarioParameter name="Max_BW_Dem" value="50.0"/>
<ScenarioParameter name="Min_BW_Res" value="30.0"/>
<ScenarioParameter name="Max_BW_Res" value="100.0"/>
<ScenarioParameter name="Min_CPU_Dem" value="10.0"/>
<ScenarioParameter name="Max_CPU_Dem" value="50.0"/>
<ScenarioParameter name="Min_CPU_Res" value="30.0"/>
<ScenarioParameter name="Max_CPU_Res" value="100.0"/>
<ScenarioParameter name="NumberOfRun" value="1.0"/>
<ScenarioMetric name="Runtime" result="846.0"/>
<ScenarioMetric name="RejectedNetworksNumber" result="0.0"/>
<ScenarioMetric name="VertexConnectivity2" result="1.0"/>
<ScenarioMetric name="AlgebraicConnectivity2" result="1.741814530894711"/>
<ScenarioMetric name="EdgeConnectivity2" result="1.0"/>
<ScenarioMetric name="FabianianCoefficient2" result="1.0"/>
<ScenarioMetric name="SpectralGap2" result="1.0019396461682453"/>
<ScenarioMetric name="StochasticMetric2" result="0.868390100905683"/>
<ScenarioMetric name="VertexConnectivity0" result="1.0"/>
<ScenarioMetric name="AlgebraicConnectivity0" result="1.854673959898261"/>
<ScenarioMetric name="EdgeConnectivity0" result="1.0"/>
<ScenarioMetric name="FabianianCoefficient0" result="1.0"/>
<ScenarioMetric name="SpectralGap0" result="1.295691487310222"/>
<ScenarioMetric name="StochasticMetric0" result="0.6805885859898158"/>
</ScenarioResult>
<ScenarioResult>
<ScenarioParameter name="Waxman_alpha" value="0.4"/>
<ScenarioParameter name="Waxman_beta" value="0.5"/>
<ScenarioParameter name="NumVNodesPerNet" value="9.0"/>
<ScenarioParameter name="NumVNets" value="1.0"/>
<ScenarioParameter name="SNetSize" value="100.0"/>
<ScenarioParameter name="Min_BW_Dem" value="10.0"/>
<ScenarioParameter name="Max_BW_Dem" value="50.0"/>
<ScenarioParameter name="Min_BW_Res" value="30.0"/>
<ScenarioParameter name="Max_BW_Res" value="100.0"/>
<ScenarioParameter name="Min_CPU_Dem" value="10.0"/>
<ScenarioParameter name="Max_CPU_Dem" value="50.0"/>
<ScenarioParameter name="Min_CPU_Res" value="30.0"/>
<ScenarioParameter name="Max_CPU_Res" value="100.0"/>
<ScenarioParameter name="NumberOfRun" value="1.0"/>
<ScenarioMetric name="Runtime" result="609.0"/>
<ScenarioMetric name="RejectedNetworksNumber" result="0.0"/>
<ScenarioMetric name="VertexConnectivity2" result="2.0"/>
<ScenarioMetric name="AlgebraicConnectivity2" result="2.212517958069722"/>
<ScenarioMetric name="EdgeConnectivity2" result="2.0"/>
<ScenarioMetric name="FabianianCoefficient2" result="1.0"/>
<ScenarioMetric name="SpectralGap2" result="0.08677137867839191"/>
<ScenarioMetric name="StochasticMetric2" result="1.9927278019276755"/>
<ScenarioMetric name="VertexConnectivity0" result="2.0"/>
<ScenarioMetric name="AlgebraicConnectivity0" result="1.6370875136672722"/>
<ScenarioMetric name="EdgeConnectivity0" result="2.0"/>
<ScenarioMetric name="FabianianCoefficient0" result="1.0"/>
<ScenarioMetric name="SpectralGap0" result="1.8573960873462065"/>
<ScenarioMetric name="StochasticMetric0" result="1.7266332660325572"/>
</ScenarioResult>
<ScenarioResult>
<ScenarioParameter name="Waxman_alpha" value="0.4"/>
<ScenarioParameter name="Waxman_beta" value="0.5"/>
<ScenarioParameter name="NumVNodesPerNet" value="10.0"/>
<ScenarioParameter name="NumVNets" value="1.0"/>
<ScenarioParameter name="SNetSize" value="100.0"/>
<ScenarioParameter name="Min_BW_Dem" value="10.0"/>
<ScenarioParameter name="Max_BW_Dem" value="50.0"/>
<ScenarioParameter name="Min_BW_Res" value="30.0"/>
<ScenarioParameter name="Max_BW_Res" value="100.0"/>
<ScenarioParameter name="Min_CPU_Dem" value="10.0"/>
<ScenarioParameter name="Max_CPU_Dem" value="50.0"/>
<ScenarioParameter name="Min_CPU_Res" value="30.0"/>
<ScenarioParameter name="Max_CPU_Res" value="100.0"/>
<ScenarioParameter name="NumberOfRun" value="1.0"/>
<ScenarioMetric name="Runtime" result="578.0"/>
<ScenarioMetric name="RejectedNetworksNumber" result="0.0"/>
<ScenarioMetric name="VertexConnectivity2" result="1.0"/>
<ScenarioMetric name="AlgebraicConnectivity2" result="2.145412191385898"/>
<ScenarioMetric name="EdgeConnectivity2" result="1.0"/>
<ScenarioMetric name="FabianianCoefficient2" result="1.0"/>
<ScenarioMetric name="SpectralGap2" result="0.826946783775961"/>
<ScenarioMetric name="StochasticMetric2" result="1.8202071941911595"/>
<ScenarioMetric name="VertexConnectivity0" result="1.0"/>
<ScenarioMetric name="AlgebraicConnectivity0" result="1.5890364574294114"/>
<ScenarioMetric name="EdgeConnectivity0" result="1.0"/>
<ScenarioMetric name="FabianianCoefficient0" result="1.0"/>
<ScenarioMetric name="SpectralGap0" result="2.2117994159315804"/>
<ScenarioMetric name="StochasticMetric0" result="1.1993780131111107"/>
</ScenarioResult>
<ScenarioResult>
<ScenarioParameter name="Waxman_alpha" value="0.4"/>
<ScenarioParameter name="Waxman_beta" value="0.5"/>
<ScenarioParameter name="NumVNodesPerNet" value="11.0"/>
<ScenarioParameter name="NumVNets" value="1.0"/>
<ScenarioParameter name="SNetSize" value="100.0"/>
<ScenarioParameter name="Min_BW_Dem" value="10.0"/>
<ScenarioParameter name="Max_BW_Dem" value="50.0"/>
<ScenarioParameter name="Min_BW_Res" value="30.0"/>
<ScenarioParameter name="Max_BW_Res" value="100.0"/>
<ScenarioParameter name="Min_CPU_Dem" value="10.0"/>
<ScenarioParameter name="Max_CPU_Dem" value="50.0"/>
<ScenarioParameter name="Min_CPU_Res" value="30.0"/>
<ScenarioParameter name="Max_CPU_Res" value="100.0"/>
<ScenarioParameter name="NumberOfRun" value="1.0"/>
<ScenarioMetric name="Runtime" result="797.0"/>
<ScenarioMetric name="RejectedNetworksNumber" result="0.0"/>
<ScenarioMetric name="VertexConnectivity2" result="2.0"/>
<ScenarioMetric name="AlgebraicConnectivity2" result="2.3954850079335364"/>
<ScenarioMetric name="EdgeConnectivity2" result="2.0"/>
<ScenarioMetric name="FabianianCoefficient2" result="1.0"/>
<ScenarioMetric name="SpectralGap2" result="0.019578501527560466"/>
<ScenarioMetric name="StochasticMetric2" result="3.0860109027715414"/>
<ScenarioMetric name="VertexConnectivity0" result="3.0"/>
<ScenarioMetric name="AlgebraicConnectivity0" result="1.854555495387745"/>
<ScenarioMetric name="EdgeConnectivity0" result="3.0"/>
<ScenarioMetric name="FabianianCoefficient0" result="1.0"/>
<ScenarioMetric name="SpectralGap0" result="3.584217996538307"/>
<ScenarioMetric name="StochasticMetric0" result="2.1648172533072234"/>
</ScenarioResult>
<ScenarioResult>
<ScenarioParameter name="Waxman_alpha" value="0.4"/>
<ScenarioParameter name="Waxman_beta" value="0.5"/>
<ScenarioParameter name="NumVNodesPerNet" value="12.0"/>
<ScenarioParameter name="NumVNets" value="1.0"/>
<ScenarioParameter name="SNetSize" value="100.0"/>
<ScenarioParameter name="Min_BW_Dem" value="10.0"/>
<ScenarioParameter name="Max_BW_Dem" value="50.0"/>
<ScenarioParameter name="Min_BW_Res" value="30.0"/>
<ScenarioParameter name="Max_BW_Res" value="100.0"/>
<ScenarioParameter name="Min_CPU_Dem" value="10.0"/>
<ScenarioParameter name="Max_CPU_Dem" value="50.0"/>
<ScenarioParameter name="Min_CPU_Res" value="30.0"/>
<ScenarioParameter name="Max_CPU_Res" value="100.0"/>
<ScenarioParameter name="NumberOfRun" value="1.0"/>
<ScenarioMetric name="Runtime" result="892.0"/>
<ScenarioMetric name="RejectedNetworksNumber" result="0.0"/>
<ScenarioMetric name="VertexConnectivity2" result="2.0"/>
<ScenarioMetric name="AlgebraicConnectivity2" result="2.4913004237744385"/>
<ScenarioMetric name="EdgeConnectivity2" result="2.0"/>
<ScenarioMetric name="FabianianCoefficient2" result="1.0"/>
<ScenarioMetric name="SpectralGap2" result="0.7696498939789347"/>
<ScenarioMetric name="StochasticMetric2" result="2.201723978314626"/>
<ScenarioMetric name="VertexConnectivity0" result="2.0"/>
<ScenarioMetric name="AlgebraicConnectivity0" result="2.04191205905592"/>
<ScenarioMetric name="EdgeConnectivity0" result="2.0"/>
<ScenarioMetric name="FabianianCoefficient0" result="1.0"/>
<ScenarioMetric name="SpectralGap0" result="2.376993537716656"/>
<ScenarioMetric name="StochasticMetric0" result="3.034262661127799"/>
</ScenarioResult>
<ScenarioResult>
<ScenarioParameter name="Waxman_alpha" value="0.4"/>
<ScenarioParameter name="Waxman_beta" value="0.5"/>
<ScenarioParameter name="NumVNodesPerNet" value="13.0"/>
<ScenarioParameter name="NumVNets" value="1.0"/>
<ScenarioParameter name="SNetSize" value="100.0"/>
<ScenarioParameter name="Min_BW_Dem" value="10.0"/>
<ScenarioParameter name="Max_BW_Dem" value="50.0"/>
<ScenarioParameter name="Min_BW_Res" value="30.0"/>
<ScenarioParameter name="Max_BW_Res" value="100.0"/>
<ScenarioParameter name="Min_CPU_Dem" value="10.0"/>
<ScenarioParameter name="Max_CPU_Dem" value="50.0"/>
<ScenarioParameter name="Min_CPU_Res" value="30.0"/>
<ScenarioParameter name="Max_CPU_Res" value="100.0"/>
<ScenarioParameter name="NumberOfRun" value="1.0"/>
<ScenarioMetric name="Runtime" result="872.0"/>
<ScenarioMetric name="RejectedNetworksNumber" result="0.0"/>
<ScenarioMetric name="VertexConnectivity2" result="2.0"/>
<ScenarioMetric name="AlgebraicConnectivity2" result="2.047126232292386"/>
<ScenarioMetric name="EdgeConnectivity2" result="2.0"/>
<ScenarioMetric name="FabianianCoefficient2" result="1.0"/>
<ScenarioMetric name="SpectralGap2" result="0.9952229587725951"/>
<ScenarioMetric name="StochasticMetric2" result="3.3794406500249257"/>
<ScenarioMetric name="VertexConnectivity0" result="2.0"/>
<ScenarioMetric name="AlgebraicConnectivity0" result="1.6523543005400327"/>
<ScenarioMetric name="EdgeConnectivity0" result="2.0"/>
<ScenarioMetric name="FabianianCoefficient0" result="1.0"/>
<ScenarioMetric name="SpectralGap0" result="3.048441149178422"/>
<ScenarioMetric name="StochasticMetric0" result="3.133358034963522"/>
</ScenarioResult>
<ScenarioResult>
<ScenarioParameter name="Waxman_alpha" value="0.4"/>
<ScenarioParameter name="Waxman_beta" value="0.5"/>
<ScenarioParameter name="NumVNodesPerNet" value="14.0"/>
<ScenarioParameter name="NumVNets" value="1.0"/>
<ScenarioParameter name="SNetSize" value="100.0"/>
<ScenarioParameter name="Min_BW_Dem" value="10.0"/>
<ScenarioParameter name="Max_BW_Dem" value="50.0"/>
<ScenarioParameter name="Min_BW_Res" value="30.0"/>
<ScenarioParameter name="Max_BW_Res" value="100.0"/>
<ScenarioParameter name="Min_CPU_Dem" value="10.0"/>
<ScenarioParameter name="Max_CPU_Dem" value="50.0"/>
<ScenarioParameter name="Min_CPU_Res" value="30.0"/>
<ScenarioParameter name="Max_CPU_Res" value="100.0"/>
<ScenarioParameter name="NumberOfRun" value="1.0"/>
<ScenarioMetric name="Runtime" result="891.0"/>
<ScenarioMetric name="RejectedNetworksNumber" result="0.0"/>
<ScenarioMetric name="VertexConnectivity2" result="2.0"/>
<ScenarioMetric name="AlgebraicConnectivity2" result="1.987660356945407"/>
<ScenarioMetric name="EdgeConnectivity2" result="2.0"/>
<ScenarioMetric name="FabianianCoefficient2" result="1.0"/>
<ScenarioMetric name="SpectralGap2" result="0.2484076205543828"/>
<ScenarioMetric name="StochasticMetric2" result="3.9080988222890496"/>
<ScenarioMetric name="VertexConnectivity0" result="2.0"/>
<ScenarioMetric name="AlgebraicConnectivity0" result="2.1670218484160566"/>
<ScenarioMetric name="EdgeConnectivity0" result="2.0"/>
<ScenarioMetric name="FabianianCoefficient0" result="1.0"/>
<ScenarioMetric name="SpectralGap0" result="3.2472187629267433"/>
<ScenarioMetric name="StochasticMetric0" result="3.1328785000072386"/>
</ScenarioResult>
<ScenarioResult>
<ScenarioParameter name="Waxman_alpha" value="0.4"/>
<ScenarioParameter name="Waxman_beta" value="0.5"/>
<ScenarioParameter name="NumVNodesPerNet" value="15.0"/>
<ScenarioParameter name="NumVNets" value="1.0"/>
<ScenarioParameter name="SNetSize" value="100.0"/>
<ScenarioParameter name="Min_BW_Dem" value="10.0"/>
<ScenarioParameter name="Max_BW_Dem" value="50.0"/>
<ScenarioParameter name="Min_BW_Res" value="30.0"/>
<ScenarioParameter name="Max_BW_Res" value="100.0"/>
<ScenarioParameter name="Min_CPU_Dem" value="10.0"/>
<ScenarioParameter name="Max_CPU_Dem" value="50.0"/>
<ScenarioParameter name="Min_CPU_Res" value="30.0"/>
<ScenarioParameter name="Max_CPU_Res" value="100.0"/>
<ScenarioParameter name="NumberOfRun" value="1.0"/>
<ScenarioMetric name="Runtime" result="1162.0"/>
<ScenarioMetric name="RejectedNetworksNumber" result="0.0"/>
<ScenarioMetric name="VertexConnectivity2" result="2.0"/>
<ScenarioMetric name="AlgebraicConnectivity2" result="2.2234619923069414"/>
<ScenarioMetric name="EdgeConnectivity2" result="2.0"/>
<ScenarioMetric name="FabianianCoefficient2" result="1.0"/>
<ScenarioMetric name="SpectralGap2" result="0.45771183680269933"/>
<ScenarioMetric name="StochasticMetric2" result="2.9215253413041196"/>
<ScenarioMetric name="VertexConnectivity0" result="2.0"/>
<ScenarioMetric name="AlgebraicConnectivity0" result="2.054840069986192"/>
<ScenarioMetric name="EdgeConnectivity0" result="2.0"/>
<ScenarioMetric name="FabianianCoefficient0" result="1.0"/>
<ScenarioMetric name="SpectralGap0" result="3.442550183039827"/>
<ScenarioMetric name="StochasticMetric0" result="3.995284651861695"/>
</ScenarioResult>
<ScenarioResult>
<ScenarioParameter name="Waxman_alpha" value="0.4"/>
<ScenarioParameter name="Waxman_beta" value="0.5"/>
<ScenarioParameter name="NumVNodesPerNet" value="16.0"/>
<ScenarioParameter name="NumVNets" value="1.0"/>
<ScenarioParameter name="SNetSize" value="100.0"/>
<ScenarioParameter name="Min_BW_Dem" value="10.0"/>
<ScenarioParameter name="Max_BW_Dem" value="50.0"/>
<ScenarioParameter name="Min_BW_Res" value="30.0"/>
<ScenarioParameter name="Max_BW_Res" value="100.0"/>
<ScenarioParameter name="Min_CPU_Dem" value="10.0"/>
<ScenarioParameter name="Max_CPU_Dem" value="50.0"/>
<ScenarioParameter name="Min_CPU_Res" value="30.0"/>
<ScenarioParameter name="Max_CPU_Res" value="100.0"/>
<ScenarioParameter name="NumberOfRun" value="1.0"/>
<ScenarioMetric name="Runtime" result="1113.0"/>
<ScenarioMetric name="RejectedNetworksNumber" result="0.0"/>
<ScenarioMetric name="VertexConnectivity2" result="1.0"/>
<ScenarioMetric name="AlgebraicConnectivity2" result="2.0926238844236447"/>
<ScenarioMetric name="EdgeConnectivity2" result="1.0"/>
<ScenarioMetric name="FabianianCoefficient2" result="1.0"/>
<ScenarioMetric name="SpectralGap2" result="0.7808319615152142"/>
<ScenarioMetric name="StochasticMetric2" result="3.0087947748201787"/>
<ScenarioMetric name="VertexConnectivity0" result="1.0"/>
<ScenarioMetric name="AlgebraicConnectivity0" result="2.1883371528470357"/>
<ScenarioMetric name="EdgeConnectivity0" result="1.0"/>
<ScenarioMetric name="FabianianCoefficient0" result="1.0"/>
<ScenarioMetric name="SpectralGap0" result="3.663210710605434"/>
<ScenarioMetric name="StochasticMetric0" result="2.7728208750298773"/>
</ScenarioResult>
<ScenarioResult>
<ScenarioParameter name="Waxman_alpha" value="0.4"/>
<ScenarioParameter name="Waxman_beta" value="0.5"/>
<ScenarioParameter name="NumVNodesPerNet" value="17.0"/>
<ScenarioParameter name="NumVNets" value="1.0"/>
<ScenarioParameter name="SNetSize" value="100.0"/>
<ScenarioParameter name="Min_BW_Dem" value="10.0"/>
<ScenarioParameter name="Max_BW_Dem" value="50.0"/>
<ScenarioParameter name="Min_BW_Res" value="30.0"/>
<ScenarioParameter name="Max_BW_Res" value="100.0"/>
<ScenarioParameter name="Min_CPU_Dem" value="10.0"/>
<ScenarioParameter name="Max_CPU_Dem" value="50.0"/>
<ScenarioParameter name="Min_CPU_Res" value="30.0"/>
<ScenarioParameter name="Max_CPU_Res" value="100.0"/>
<ScenarioParameter name="NumberOfRun" value="1.0"/>
<ScenarioMetric name="Runtime" result="2454.0"/>
<ScenarioMetric name="RejectedNetworksNumber" result="0.0"/>
<ScenarioMetric name="VertexConnectivity2" result="2.0"/>
<ScenarioMetric name="AlgebraicConnectivity2" result="2.23606797749979"/>
<ScenarioMetric name="EdgeConnectivity2" result="2.0"/>
<ScenarioMetric name="FabianianCoefficient2" result="1.0"/>
<ScenarioMetric name="SpectralGap2" result="0.0"/>
<ScenarioMetric name="StochasticMetric2" result="4.143188604518091"/>
<ScenarioMetric name="VertexConnectivity0" result="4.0"/>
<ScenarioMetric name="AlgebraicConnectivity0" result="3.2916550003635034"/>
<ScenarioMetric name="EdgeConnectivity0" result="4.0"/>
<ScenarioMetric name="FabianianCoefficient0" result="1.0"/>
<ScenarioMetric name="SpectralGap0" result="2.7605883080698828"/>
<ScenarioMetric name="StochasticMetric0" result="5.220399731228472"/>
</ScenarioResult>
<ScenarioResult>
<ScenarioParameter name="Waxman_alpha" value="0.4"/>
<ScenarioParameter name="Waxman_beta" value="0.5"/>
<ScenarioParameter name="NumVNodesPerNet" value="18.0"/>
<ScenarioParameter name="NumVNets" value="1.0"/>
<ScenarioParameter name="SNetSize" value="100.0"/>
<ScenarioParameter name="Min_BW_Dem" value="10.0"/>
<ScenarioParameter name="Max_BW_Dem" value="50.0"/>
<ScenarioParameter name="Min_BW_Res" value="30.0"/>
<ScenarioParameter name="Max_BW_Res" value="100.0"/>
<ScenarioParameter name="Min_CPU_Dem" value="10.0"/>
<ScenarioParameter name="Max_CPU_Dem" value="50.0"/>
<ScenarioParameter name="Min_CPU_Res" value="30.0"/>
<ScenarioParameter name="Max_CPU_Res" value="100.0"/>
<ScenarioParameter name="NumberOfRun" value="1.0"/>
<ScenarioMetric name="Runtime" result="2516.0"/>
<ScenarioMetric name="RejectedNetworksNumber" result="0.0"/>
<ScenarioMetric name="VertexConnectivity2" result="2.0"/>
<ScenarioMetric name="AlgebraicConnectivity2" result="1.9840593925343335"/>
<ScenarioMetric name="EdgeConnectivity2" result="2.0"/>
<ScenarioMetric name="FabianianCoefficient2" result="1.0"/>
<ScenarioMetric name="SpectralGap2" result="0.3636812390986559"/>
<ScenarioMetric name="StochasticMetric2" result="4.238514242266579"/>
<ScenarioMetric name="VertexConnectivity0" result="3.0"/>
<ScenarioMetric name="AlgebraicConnectivity0" result="2.2503830421805113"/>
<ScenarioMetric name="EdgeConnectivity0" result="3.0"/>
<ScenarioMetric name="FabianianCoefficient0" result="1.0"/>
<ScenarioMetric name="SpectralGap0" result="4.0227880048448625"/>
<ScenarioMetric name="StochasticMetric0" result="6.649563197244915"/>
</ScenarioResult>
</MappingTest>
最佳答案
您可以将xmlGetAttr
与name = "result"
一起使用:
library(XML)
doc <- xmlParse(xData)
res <- doc['//*[@name = "VertexConnectivity2"]'
, fun = function(x) xmlGetAttr(x, "result")]
> as.numeric(res)
[1] 1 1 2 1 2 2 2 2 2 1 2 2
result
属性:
library(XML)
doc <- xmlParse(xData)
> as.numeric(doc['//*[@name = "VertexConnectivity2"]/@result'])
[1] 1 1 2 1 2 2 2 2 2 1 2 2
name="NumVNodesPerNet"
且属性为
value="14.0"
的节点:
//*[@name="NumVNodesPerNet" and @value="14.0"]
/..
name = "VertexConnectivity2"
的节点
/*[@name = "VertexConnectivity2"]
/@result
myXpath <- '//*[@name="NumVNodesPerNet" and @value="14.0"]/../*[@name = "VertexConnectivity2"]/@result'
> as.numeric(doc[myXpath])
[1] 2
关于xml - 如何在R中将xpath用于多个xml属性,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26687855/
我是一名优秀的程序员,十分优秀!