Archives for: August 2005, 31

Aug 31, 2005 : xpath and namespaces

After a lot of googling, I finally found how to get xpath and xml namespaces to work together. The way I ended up doing it was this to duplicate the default namespace and reference it everywhere.

XML file:
<web-app xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:j2ee="http://java.sun.com/xml/ns/j2ee" ...>
...
</web-app>

XPath:
//j2ee:web-app/j2ee:servlet[j2ee:servlet-name='myapp']

<  August 2005  >
Mon Tue Wed Thu Fri Sat Sun
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30 31        

Categories


Archives

Misc

Syndicate this blog XML

powered by
b2evolution