2个关键字之间的Xpath文本提取 [英] Xpath text extraction between 2 keywords

查看:34
本文介绍了2个关键字之间的Xpath文本提取的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有返回 2 个关键字之间可用文本的 xpath 表达式?

Is there an xpath expression that return the text available between 2 keywords?

例如,我们有一个如下所示的跨度:

For example we have a span like the following:

<b>Specialty: </b>PO<br/><b>Job Function: </b>RN<br/><br/><b>Qualifications/Duties</b><br/>Texas Health Presbyterian Allen is currently in search of a Registered Nurse to help meet the growing needs of our Day Surgery Department to work PRN in Day Surgery and also float to PACU.<br/><br/><b>Basic Qualifications:</b><br/><br/>*Graduate of an accredited school of nursing<br/>*Valid RN license in the state of Texas<br/>*BLS<br/>*ACLS<br/>*PALS within 6 months of hire<br/>*Minimum of 1 - 3 years experience as RN in Day Surgery, PACU, Outpatient Surgery, or ICU<br/>*Strong organizational skills and ability to function in a fast paced work environment<br/>*Ability to accept responsibility and show initiative to work without direct supervision<br/>*A high degree of confidentiality, positive interpersonal skills and ability to function in a fast-paced environment<br/><br/><b>Preferred Qualifications:</b><br/><br/>*Three years RN experience in Outpatient Surgery along with some ICU experience.<br/>*PALS<br/>*PACU , Endoscopy or Ambulatory setting<br/>*IV Conscious Sedation<br/><br/><b>Hours/Schedule:</b><br/><br/>*Variable<br/><br/>J2WPeriop<br/><br/><b>Entity Information</b><br/>Texas Health Presbyterian Hospital Allen is a 73-bed, acute-care hospital serving the northern Collin County area since 2000. Hospital services include women’s care, a Level II neonatal intensive care unit, orthopedics, pediatrics, wound care and sleep medicine. Texas Health Allen, a Pathway to Excellence® designated hospital by the American Nurses Credentialing Center, has more than 500 physicians on its medical staff practicing in more than 25 specialties. Texas Health Allen is a World Health Organization-designated "Baby-Friendly Hospital" and was the first hospital in Texas to receive the distinction. The hospital is a Level IV trauma center and an Accredited Chest Pain Center by the Society of Chest Pain Centers, which makes our facility intensely qualified to serve our community and your professional aspirations.<br/>

我想知道我们是否可以定义一个 xpath 来返回 2 个关键字之间可用的所有文本,例如资格/职责"和实体信息"

I would like to know if we can define an xpath to return all the text that is available between 2 keywords say "Qualifications/Duties" and "Entity Information"

推荐答案

是的,但不要期望格式很好的输出,标记很杂乱,表达式可能需要稍微调整一下,以确定您是否还想要带有的节点"Basic Qualifications:" 与否(此版本跳过它们,只需要裸"文本节点).

Yes, but don't expect a nicely formatted output, the markup is messy and the expression might need some slight tweaks for whether you also want the nodes with "Basic Qualifications:" or not (this version skips them, it only takes "naked" text nodes).

//text()[preceding-sibling::*[text()='Qualifications/Duties'] and following-sibling::*[text()='Entity Information']]

这意味着:

//text()
SELECT EVERY TEXT NODE
   [
    THAT
    preceding-sibling::*[text()='Qualifications/Duties']
    IS PRECEDED BY A NODE WITH TEXT = "Qualifications/Duties"
    and following-sibling::*[text()='Entity Information'
    AND FOLLOWED BY A NODE WITH TEXT = "Entity Information"
   ]

示例的输出:

Texas Health Presbyterian Allen is currently in search of a Registered Nurse to help meet the growing needs of our Day Surgery Department to work PRN in Day Surgery and also float to PACU.
*Graduate of an accredited school of nursing
*Valid RN license in the state of Texas
*BLS
*ACLS
*PALS within 6 months of hire
*Minimum of 1 - 3 years experience as RN in Day Surgery, PACU, Outpatient Surgery, or ICU
*Strong organizational skills and ability to function in a fast paced work environment
*Ability to accept responsibility and show initiative to work without direct supervision
*A high degree of confidentiality, positive interpersonal skills and ability to function in a fast-paced environment
*Three years RN experience in Outpatient Surgery along with some ICU experience.
*PALS
*PACU , Endoscopy or Ambulatory setting
*IV Conscious Sedation
*Variable
J2WPeriop

这篇关于2个关键字之间的Xpath文本提取的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆