select xml element from web.xml using xmlstarlet -


i'm using xmlstarlet select values web.xml. not working , returns nothing. if web.xml contains following properties:

<web-app version="2.4"    xmlns="java.sun.com/xml/ns/j2ee"    xmlns:xsi="w3.org/2001/xmlschema-instance"    xsi:schemalocation="java.sun.com/xml/ns/j2ee java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"> 

command i'm executing

xml select -t -v "web-app/display-name" web.xml  

how can ignore above ?

if have version 1.5.0, default namespace (java.sun.com/xml/ns/j2ee in case) automatically given prefix _, -n not needed:

xml sel -t -v "_:web-app/_:security-role" /root/web-inf/web.xml 

Comments

Popular posts from this blog

php - Calling a template part from a post -

Firefox SVG shape not printing when it has stroke -

How to mention the localhost in android -