|
I've been using CachedXPathAPI for lots of things lately (from Xalan, the 2.6.0 version in particular), as well as XMLUnit.
XMLUnit has the very nice: assertXPathExists, but this does NOT work if you are using a default namespace. You cannot xpath
for "//FeatureCollection" because FeatureCollection occurs in the default namespace
xmlns="http://mydomain/schemas"
Using an xpath string "//:FeatureCollection/gml:featureMember" does work in xalan-2.6.0's xpathapi, assuming you have a namespaceaware document or a node from a namespaceaware document.
I use //*[local-name()='featureMember'] to get past any particular namespace (or no namespace or default namespace .... catch my breath)
|