0

我有一个 xml 提要,它将职位空缺数据带到我正在开发的网站。

如果没有工作,XML 提要将说明

<message>No Vacancies were found matching your search criteria.</message>

我可以看到“没有空缺...”消息,但它只会显示 XML 的第一个结果(我知道应该有多个工作结果)。

这就是 XML 输出的方式

    <nhs_search>

  <status>
    <number_of_jobs_found>2</number_of_jobs_found>
    <message></message>
  </status>

  <vacancy_details>
    <id>913159135</id>
    <job_reference>489-CCG-03</job_reference>
    <job_title>Clinical Project Manager</job_title>
    <job_description>Clinical Commissioning Groups (CCGs) have a shared management team. . These posts will complement the current team of clinical project managers that we already have. The posts are...</job_description>
    <job_type>Fixed Term Temporary</job_type>
    <job_specialty></job_specialty>
    <job_salary>&#163;30,764 to &#163;40,558 pa</job_salary>
    <job_location>England</job_location>
    <job_closedate>12/08/2013</job_closedate>
    <job_postdate>29/07/2013</job_postdate>
    <job_url>http://www.jobs.nhs.uk/cgi-bin/vacdetails.cgi?selection=567657567</job_url>
  </vacancy_details>

  <vacancy_details>
    <id>913155230</id>
    <job_reference>489-CCG-02</job_reference>
    <job_title>Designated Nurse for Children in Care</job_title>
    <job_description>Are you experienced in working with looked after children? If you are we would be interested to hear from you. An exciting opportunity has arisen for an experienced nurse to join the Clinical Commissioning Group in the role of Designated Nurse for Children in Care. This new post will also support the Designated Nurse for Safeguarding Children. In line with...</job_description>
    <job_type>Permanent</job_type>
    <job_specialty>Nursing</job_specialty>
    <job_salary>&#163;39,239 to &#163;47,088 pa</job_salary>
    <job_location>England</job_location>
    <job_closedate>30/07/2013</job_closedate>
    <job_postdate>23/07/2013</job_postdate>
    <job_url>http://www.jobs.nhs.uk/cgi-bin/vacdetails.cgi?selection=54678965</job_url>
  </vacancy_details>

</nhs_search>

XPath 当前设置为

XPath="nhs_search"

页面代码是

<ItemTemplate> 

                <tr>                    
                    <td class="vacs"><asp:HyperLink NavigateUrl='<%# XPath("vacancy_details/job_url") %>' Text='<%# XPath("vacancy_details/job_title") %>' Target="_blank" runat="server" ID="Hyperlink2" />
                    <br /><%# XPath("vacancy_details/job_specialty")%></td> 
                    <td class="vacs"><%# XPath("vacancy_details/job_salary")%></td>
                    <td class="vacs"><%# XPath("vacancy_details/job_closedate")%></td>
                 </tr>
                 <td class="vacs"><%# XPath("status/message")%></td>
                 <tr>

                 </tr>
        </ItemTemplate>

问题是这段代码只会带来最好的结果吗?我怎样才能让它通过所有搜索结果?

4

0 回答 0