diff --git a/xdoc/src/main/org/apache/maven/NavBean.java b/xdoc/src/main/org/apache/maven/NavBean.java index 5fcf9b52..d7484a57 100644 --- a/xdoc/src/main/org/apache/maven/NavBean.java +++ b/xdoc/src/main/org/apache/maven/NavBean.java @@ -64,7 +64,7 @@ import org.dom4j.tree.DefaultElement; /** * @author Ben Walding - * @version $Id: NavBean.java,v 1.3 2003/02/18 14:21:35 bwalding Exp $ + * @version $Id: NavBean.java,v 1.4 2003/03/10 14:18:41 bwalding Exp $ */ public class NavBean { @@ -128,8 +128,17 @@ public class NavBean return false; } - String xpath = ".//item[@href='" + location + "']"; + //System.out.println(elem.asXML()); + String xpath; + if (location.startsWith("/") || location.startsWith(".")) { + xpath = ".//item[@href='" + location + "']"; + } else { + xpath = ".//item[@href='/" + location + "']"; + + } + + List l = elem.selectNodes(xpath); if (l.size() != 0) @@ -167,6 +176,9 @@ public class NavBean */ public void setLocation(String location) { + if (!location.startsWith("/")) + location = "/" + location; + this.location = location; }