public void testid54614() throws JaxenException {
Navigator nav = getNavigator();
String url = TESTS_ROOT + "xml/moreover.xml";
log("Document [" + url + "]");
Object document = nav.getDocument(url);
XPath contextpath = new BaseXPath("/", nav);
log("Initial Context :: " + contextpath);
List list = contextpath.selectNodes(document);
Iterator iter = list.iterator();
while (iter.hasNext()) {
Object context = iter.next();
assertCountXPath(1, context, "/child::node()");
assertCountXPath(1, context, "/*");
assertCountXPath(20, context, "/*/article");
assertCountXPath(221, context, "//*");
assertCountXPath(20, context, "//*[local-name()='article']");
assertCountXPath(20, context, "//article");
assertCountXPath(20, context, "/*/*[@code]");
assertCountXPath(1, context, "/moreovernews/article[@code='13563275']");
try {
BaseXPath xpath =
new BaseXPath("/moreovernews/article[@code='13563275']", getNavigator());
List results = xpath.selectNodes(getContext(context));
Object result = results.get(0);
assertValueOfXPath("http://c.moreover.com/click/here.pl?x13563273", result, "url");
}
catch (UnsupportedAxisException e) {
log(debug, " ## SKIPPED -- Unsupported Axis");
}
try {
BaseXPath xpath = new BaseXPath("/*/article[@code='13563275']", getNavigator());
List results = xpath.selectNodes(getContext(context));
Object result = results.get(0);
assertValueOfXPath("http://c.moreover.com/click/here.pl?x13563273", result, "url");
}
catch (UnsupportedAxisException e) {
log(debug, " ## SKIPPED -- Unsupported Axis");
}
try {
BaseXPath xpath = new BaseXPath("//article[@code='13563275']", getNavigator());
List results = xpath.selectNodes(getContext(context));
Object result = results.get(0);
assertValueOfXPath("http://c.moreover.com/click/here.pl?x13563273", result, "url");
}
catch (UnsupportedAxisException e) {
log(debug, " ## SKIPPED -- Unsupported Axis");
}
try {
BaseXPath xpath = new BaseXPath("//*[@code='13563275']", getNavigator());
List results = xpath.selectNodes(getContext(context));
Object result = results.get(0);
assertValueOfXPath("http://c.moreover.com/click/here.pl?x13563273", result, "url");
}
catch (UnsupportedAxisException e) {
log(debug, " ## SKIPPED -- Unsupported Axis");
}
try {
BaseXPath xpath = new BaseXPath("/child::node()/child::node()[@code='13563275']",
getNavigator());
List results = xpath.selectNodes(getContext(context));
Object result = results.get(0);
assertValueOfXPath("http://c.moreover.com/click/here.pl?x13563273", result, "url");
}
catch (UnsupportedAxisException e) {
log(debug, " ## SKIPPED -- Unsupported Axis");
}
try {
BaseXPath xpath = new BaseXPath("/*/*[@code='13563275']", getNavigator());
List results = xpath.selectNodes(getContext(context));
Object result = results.get(0);
assertValueOfXPath("http://c.moreover.com/click/here.pl?x13563273", result, "url");
}
catch (UnsupportedAxisException e) {
log(debug, " ## SKIPPED -- Unsupported Axis");