我有一个输入xml
XML:
<artifactHits>
<artifactID>test</artifactID>
<version>1.0</version>
<latestversion>1.0<latestversion>
I need to print the value of artifactId along with the tag name.
Expected output:
<artifactID>test</artifactID>
Present output:
test
Command tried:
sed -n 's%.<artifactID>\(.*\)</artifactID>.%/1\%p' test.xml
请帮助获取带有name
和value
的标签的输出