【发布时间】:2015-08-05 21:32:50
【问题描述】:
以下是我的回复数据:
<Bundle xmlns="http://hl7.org/fhir">
<id value="ffd821ee-f4d0-43fc-8eb1-df1d9bd63340"/>
<meta>
<lastUpdated value="2015-08-05T09:14:57.242-04:00"/>
</meta>
<type value="searchset"/>
<base value="http://fhirtest.uhn.ca/baseDstu2"/>
<total value="535"/>
<link>
<relation value="self"/>
<url value="http://fhirtest.uhn.ca/baseDstu2/Patient?_format=xml"/>
</link>
<link>
<relation value="next"/>
<url value="http://fhirtest.uhn.ca/baseDstu2?_getpages=0bad92c1-cfe3-4a23-bd20-e24e854c16da&_getpagesoffset=10&_count=10&_format=xml&_pretty=true"/>
</link>
</Bundle>
我需要读取<link><url> 标签的value 属性,其中<relation> 的value 属性是next。
所以,我的预期输出是http://fhirtest.uhn.ca/baseDstu2?_getpages=0bad92c1-cfe3-4a23-bd20-e24e854c16da&amp;_getpagesoffset=10&amp;_count=10&amp;_format=xml&amp;_pretty=true。
读取此内容的 XPath 表达式是什么?
【问题讨论】:
-
基于the previous question,您可能正在寻找这种XPath:
/fhi:Bundle/fhi:link[fhi:relation/@value = 'next']/fhi:url/@value,正如下面的答案中提到的那样