How to extract the value of an xml attribute?

LarryMI

New Member
How can I extract the value autolex from this xml with xpath? Currently I am trying it with this xpath expression \[code\]/Context[@path]\[/code\] but it returns the complete element. I need only the value autolex\[code\]<?xml version="1.0" encoding="UTF-8"?><!-- neue Version des context.xml zum Deployment ausserhalb des Tomcat webapps-verzeichnis --><Context path="/autolex" docBase="../../../applications/srs-autolex-1.1.1-0.war" clearReferencesStatic="true" unpackWAR="false" reloadable="false"> <Valve className="org.apache.catalina.valves.AccessLogValve" fileDateFormat="yyyy-MM-dd" pattern="%h %l %u %t "%r" %s %b "%{Referer}i" "%{User-Agent}i"" prefix="autolex." suffix=".log"/> <ResourceLink global="pendb" name="jdbc/DataSource" type="javax.sql.DataSource"/> <WatchedResource>WEB-INF/web.xml</WatchedResource></Context>\[/code\]
 
Back
Top