xml - Getting all child names using xmlstarlet/xpath -


using xmlstarlet/xpath, how name of child elements of node? example, want child element names of /a

<a>     <b><c/></b>     <d/> </a> 

should return:

b d 

i tried

xmlstarlet sel -t -c 'name(/a/*)' - 

but gives me b

i don't think xpath 1.0 expression can it, either need xpath 2.0 /a/*/name() (which don't think xmlstarlet supports) or need use xslt or try use xmlstarlet command line options try mimic xslt. don't have access tool , not familiar details, according http://xmlstar.sourceforge.net/doc/xmlstarlet.txt try

xmlstarlet sel -t -m "/a/*" -v "name()" 

untested.


Comments

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -