I am currently parsing TEI data within R, amongst which @ana attributes in a <ref> that have several values.
My apologies for this post in the TEI list, but since parsing TEI data is very specific, I hope you will be able to help me since I am looking for an answer for few days now.
Do you know how is working the hierarchy of multiple attribute values?
Example in TEI: <ref ana="whatAction #ktu1-3_ii_l6b_tḫtṣb #confrontation #action">Action, subcategory confrontation
<stage ana="whatResult #result #defeate_ofOpposition"/></ref>
The parsing in R is done with getNodeSet and xmlGetAttr functions:
interpRef <- getNodeSet(doc,"//ns:ref[contains(@ana, 'whatAction')]", ns)
interpRef_ana <- for (i in 1:length(interpRef)) print(paste(xmlGetAttr(interpRef[[i]],"ana")))
 "whatAction #ktu1-3_ii_l6b_tḫtṣb #confrontation #action"
Do you know how I can select relevant attribute value from @ana? I would like to have only:
 "#ktu1-3_ii_l6b_tḫtṣb #confrontation"
In advance, thank you very much.