Interesting. I am assume any XPath for an element or attribute value below the BookPriceStoreFareRequest element is also failing.
You may have uncovered an XPath incompatibility such that Apache's XPathParser does not recognize a URI declaration of "##default".
I tried the same scenario using a Filter. I got mixed results.
When the xmlns:n12 namespace declaration has a URI value of "##default" and the element contains the namespace (e.g., <ns12:BookPriceStoreFareRequest>), the XPath fails with the message you indicated.
The Exception thrown is something like the below:
com.itko.lisa.xml.FilterXMLXPath - Invalid XPath: A location step was expected following the '/' or '//' token.
javax.xml.transform.TransformerException: A location step was expected following the '/' or '//' token.
at org.apache.xpath.compiler.XPathParser.error(XPathParser.java:610)
at org.apache.xpath.compiler.XPathParser.RelativeLocationPath(XPathParser.java:1639)
at org.apache.xpath.compiler.XPathParser.LocationPath(XPathParser.java:1597)
at org.apache.xpath.compiler.XPathParser.PathExpr(XPathParser.java:1317)
at org.apache.xpath.compiler.XPathParser.UnionExpr(XPathParser.java:1236)
at org.apache.xpath.compiler.XPathParser.UnaryExpr(XPathParser.java:1142)
at org.apache.xpath.compiler.XPathParser.MultiplicativeExpr(XPathParser.java:1063)
at org.apache.xpath.compiler.XPathParser.AdditiveExpr(XPathParser.java:1005)
at org.apache.xpath.compiler.XPathParser.RelationalExpr(XPathParser.java:930)
at org.apache.xpath.compiler.XPathParser.EqualityExpr(XPathParser.java:870)
at org.apache.xpath.compiler.XPathParser.AndExpr(XPathParser.java:834)
at org.apache.xpath.compiler.XPathParser.OrExpr(XPathParser.java:807)
at org.apache.xpath.compiler.XPathParser.Expr(XPathParser.java:790)
at org.apache.xpath.compiler.XPathParser.initXPath(XPathParser.java:129)
at org.apache.xpath.XPath.<init>(XPath.java:178)
at org.apache.xpath.XPathAPI.eval(XPathAPI.java:277)
at com.itko.lisa.xml.XMLXPathUtils.executeXPath(XMLXPathUtils.java:77)
If the namespace is removed from the element name (e.g., <BookPriceStoreFareRequest>) AND the xmlns:ns12 declaration contains "##default", XPathing the attribute works correctly.
If I change the xmlns:ns12 to a valid HTTP looking URI, both XPaths work.
This leads me to believe the implementation of the XPath utilities must consider the "##default" as an invalid URI under certain conditions.