Python从xm的扁平列表中获取子值

2024-05-23 16:23:53 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在从以下XML解析所有临床试验信息: https://clinicaltrials.gov/ct2/show/NCT00446316?term=imatimib&rank=1?displayxml=true

在非XML版本中(要查看它,只需删除?displayxml=true),有一个列表(特别是资格标准),其中包含数字和连字符的子级。 在XML版本中,这些连字符仍然存在,但是无法将子级作为实际的子级。你知道吗

具体问题如下:

'7. Adequate organ function including the following:', 
'- Adequate bone marrow reserve:', 
'- Total white blood cell count (WBC) > 3.0 x 109/L', 
'- Platelet count >100 x 109/L', '- Hemoglobin >8 g/dL', 
'- Hepatic:', '- Bilirubin: = 1.25 times the upper limit of normal (ULN)', 
'- Alanine transaminase (ALT): = <5 times the ULN', 
'- Aspartate transaminase (AST): = <5 times the ULN', 
'- Renal: Serum creatinine =< 1.5 times the ULN, or creatinine clearance 
=>60mL/minute as calculated by the standard Cockcroft Gault formula.'

它们应该是同一个条目(数字7)的一部分,但不是。有什么方法可以通过编程的方式

a)检测这些副标题是否存在,以及

b)使它们都成为同一条目的一部分(在某种程度上,并不一定是完美的)

非常感谢。你知道吗


Tags: the版本truecount数字xml字符times