Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
<note> <to>Tove</to> <from>Jani</from> <heading>Reminder</heading> <body>Don't forget me this weekend!</body> </note>
当元素名称作为节点给出时,答案应该是 to 和 body
使用xsh,一个围绕XML::LibXML的包装器:
open data.xml ; ls (/note/*[1] | /note/*[last()]) ;