我目前正在使用:loadTable:导入[@ source ='People'] / rep / employment_history / employment
我使用的语言允许我抓取XML中的所有记录并按照从头到尾的顺序映射它们。是否有其他语言可以让我从最后一条记录开始并以第一条记录结束?
此xpath需要应用于数百人,因此记录数量并不总是3,但我总是需要它们出现的相反顺序。
以下XML:
-<Import firmCrd="0" date="6/17/2013" source="People">
-<rep xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
-<employment_history>-<employment xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><employment_id>51379</employment_id><rep_id>14718</rep_id><emp_seq>1</emp_seq><employer_name>Fake Name</employer_name><biz_type/><employee_title>OTHER - HOME PARTY CONSULTANT INDEP. C</employee_title><street1/><street2/><city>SAN DIEGO</city><state>CA</state><zip/><country/><start_date>1988-01-01T00:00:00</start_date><end_date>1989-09-01T00:00:00</end_date><inv_related>0</inv_related><crd_seq_num>1</crd_seq_num></employment>
-<employment xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><employment_id>51380</employment_id><rep_id>14718</rep_id><emp_seq>2</emp_seq><employer_name>UNEMPLOYED</employer_name><biz_type/><employee_title>OTHER</employee_title><street1/><street2/><city>WILMINGTON</city><state>MT</state><zip/><country/><start_date>1988-01-01T00:00:00</start_date><end_date>1989-09-01T00:00:00</end_date><inv_related>0</inv_related><crd_seq_num>3</crd_seq_num></employment>
-<employment xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><employment_id>51381</employment_id><rep_id>14718</rep_id><emp_seq>3</emp_seq><employer_name>PIZZA HUT</employer_name><biz_type/><employee_title>OTHER - WAITRESS</employee_title><street1/><street2/><city>ALBANY</city><state>NY</state><zip/><country/><start_date>1989-09-01T00:00:00</start_date><end_date>1992-08-01T00:00:00</end_date><inv_related>0</inv_related><crd_seq_num>4</crd_seq_num></employment></employment_history>
答案 0 :(得分:0)
XPath没有排序或排序功能,因为您需要XQuery或XSLT。