xml解析开始标记期望R

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了xml解析开始标记期望R相关的知识,希望对你有一定的参考价值。

我不太了解xml,但我需要读取这个文件,以便R可以使用它。但是,始终存在错误“文档为空,期望开始标记,未找到<”。但我看不出错误的根源。这是xml文件:

<?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>
答案

我将你的代码复制到RStudio中,用单引号括起来并将其分配给一个对象,“doc”

doc <- '<?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"/>

余数在这里省略

然后以下似乎很好:

test <- htmlTreeParse(doc, useInternal = TRUE)

你想用类似的东西检索doc的一些元素吗?

xpathSApply(doc, "xpath expression", xmlValue, trim = TRUE)
另一答案

标准XML Parser将检查<作为第一个字符。有可能XML以非标准方式创建,可能具有隐藏字符作为第一个。您将无法在编辑器中看到它打开。

在这种情况下,尝试使用标准文件读取API读取文件的第一个字符,并尝试将字符打印到int

#Scala
import scala.io.Source
val file = Source.fromFile("filename.xml")
file.hasNext match {
 case true => println(s"Character int :${file.next.toInt}")
 case false => println(s"Empty File")
}

> Character int :65279

这实际上是零宽度不间断空间。

http://www.fileformat.info/info/unicode/char/feff/index.htm

以上是关于xml解析开始标记期望R的主要内容,如果未能解决你的问题,请参考以下文章

使用 XML 库解析未转义的 HTML 并检索标记值

在 R 中解析 HTML 文件

从 XML 声明片段获取 XML 编码:部分内容解析不支持 XmlDeclaration

无法在每个活动上解析符号“R”[重复]

使用非utf-8编码在Python中解析XML

pull 解析XML 文件