XPATH过滤器元素按XML查询中的标记名称

时间:2018-01-17 02:34:02

标签: xml xpath

我正在使用MTConnect从我的一台机器读取数据,面对从一个查询中获取多个项目。我尝试查询Web服务器,如下所示: http://192.168.1.5:5006//sample?path=//Path[@name="块"&安培;计数= 1000 我希望返回多个块(大约500个),但最终还是会收到其他所有块。

  <ComponentStream component="Path" name="path" componentId="path1_01"> 

搜索会抛出

的例外情况
  <Error errorCode="INVALID_XPATH"> The path could not be parsed.

当我从等式中删除[@name =&#34; block&#34;]时,这是返回的内容:

 <ComponentStream component="Path" name="path" componentId="path1_01">

 <Samples>
 <PathPosition dataItemId="path17_01" timestamp="2018-01-16T22:00:26.555Z" 
 name="path_position" sequence="488485" subType="ACTUAL">
 -35559.9300000000 25399.9400000000 -3349.5800000000
 </PathPosition>
 <PathFeedrate dataItemId="path18_01" timestamp="2018-01-16T22:00:26.711Z" 
 name="path_feedrate" sequence="488490" subType="ACTUAL">4592</PathFeedrate>
 <Program dataItemId="path14_01" timestamp="2018-01-16T22:00:45.656396Z" 
 name="program" sequence="488654">UNAVAILABLE</Program>
 <Events>
 <Block dataItemId="path15_01" timestamp="2018-01-16T20:49:37.922Z" 
 name="block" sequence="393138"/>
 <Block dataItemId="path15_01" timestamp="2018-01-16T22:00:13.133Z" 
 name="block" sequence="488159">O0000%</Block>
 </Events>

如何从此查询中获取单个标记名称(&#34; block&#34;)的多个结果?

0 个答案:

没有答案