Sample Header Ad - 728x90

How can XPath functions be expressed to output each input element?

2 votes
3 answers
1202 views
I'm using this command:
xmllint --xpath 'substring-after(string(//item/link), "_")' rss.xml
And get the desired output, except it's on the first element. How would I fix this to have it be applied to each link? I'm open to using any utility, so long as the sample input is accepted and one expression can be used to get the desired output. **Sample Input:**
Malicious IPs | By Last Bad Event | Project Honey Pot
    
    
    Copyright 2021 Unspam Technologies, Inc
    en-us
    July 03 2021 07:15:12 PM
    
      Image
      Project Honey Pot | Distribute Spammer Tracking System
      http://www.projecthoneypot.org 
    
    
      92.204.241.167 | C
      http://www.projecthoneypot.org/ip_92.204.241.167 
      Event: Bad Event | Total: 3,061 | First: 2021-03-27 |  Last: 2021-07-03
      July 03 2021 07:15:12 PM
    
    
      181.24.239.244
      http://www.projecthoneypot.org/ip_181.24.239.244 
      Event: Bad Event | Total: 1 | First: 2021-07-03 |  Last: 2021-07-03
      July 03 2021 07:15:12 PM
    
    
      193.243.195.66 | S
      http://www.projecthoneypot.org/ip_193.243.195.66 
      Event: Bad Event | Total: 4 | First: 2021-06-12 |  Last: 2021-07-03
      July 03 2021 07:15:12 PM
**Desired Output:**
92.204.241.167
181.24.239.244
193.243.195.66
**Present Output:**
92.204.241.167
Asked by T145 (223 rep)
Jul 4, 2021, 08:19 PM
Last activity: Jul 21, 2021, 01:27 PM