hi,
using the sample xml below:
asdfabc
RTY 08
SDF 05
some textdata here
SXF 05
xyz
WER 10
TRS 10
WER 10
qwert
need to extract the label attribute value in plus all its descendant element.
are always wrapped within (i.e. sect element with role="para" attribute and label="9999" attribute. "9999" are based on paragraph numbers).
can have more siblings, and can appear in lower levels of the xml tree but always within the wrapper element.
can somebody please help me construct the xpath expression which should give a result that looks something like the one below:
RTY 08
SDF 05
SXF 05
WER 10
TRS 10
WER 10
somebody suggested the following css expression but 'SXF 05' in the example was missed because it appeared one level lower than the other cite elements.
p doc.css('cite[role = "rg"]').map { |x| [x.text, x.parent['label']] }
thanks in advance,
emmanuel