? fStringPool.addSymbol(fStringPool.toString(prefix) + ':' + fStringPool.toString(localpart))
: localpart;
// build step
Axis axis = new Axis(Axis.ATTRIBUTE);
NodeTest nodeTest = new NodeTest(fStringPool, new QName(prefix, localpart, rawname, uri));
Step step = new Step(axis, nodeTest);
stepsVector.addElement(step);
break;
}
}
firstTokenOfLocationPath=false;
break;
}
/***
case XPath.Tokens.EXPRTOKEN_AXISNAME_SELF: {
break;
}
/***/
case XPath.Tokens.EXPRTOKEN_DOUBLE_COLON: {
// should never have a bare double colon
throw new XPathException("Not allowed to have double colon here");
}
/***
case XPath.Tokens.EXPRTOKEN_NAMETEST_ANY: {
break;
}
/***/
case XPath.Tokens.EXPRTOKEN_AXISNAME_CHILD: {
// consume "::" token and drop through
i++;
if (i == tokenCount - 1) {
throw new XPathException("expected step following '"
+xtokens.getTokenName(XPath.Tokens.EXPRTOKEN_AXISNAME_CHILD)+"::'");
}
firstTokenOfLocationPath=false;
break;
}
case XPath.Tokens.EXPRTOKEN_NAMETEST_ANY:{
Axis axis = new Axis(Axis.CHILD);
NodeTest nodeTest = new NodeTest(NodeTest.WILDCARD);
Step step = new Step(axis, nodeTest);
stepsVector.addElement(step);
firstTokenOfLocationPath=false;
break;
}
case XPath.Tokens.EXPRTOKEN_NAMETEST_NAMESPACE:{
isNamespace=true;
}
case XPath.Tokens.EXPRTOKEN_NAMETEST_QNAME: {
// consume QName token
token = xtokens.getToken(++i);
int prefix = xtokens.getTokenString(token);
int uri = StringPool.EMPTY_STRING;
if (context != null && prefix != -1) {
uri = context.getNamespaceForPrefix(prefix);
}
if (prefix != -1 && context != null &&
uri == StringPool.EMPTY_STRING) {
throw new XPathException("prefix "+fStringPool.toString(prefix)+" not bound to namespace URI");
}
if (isNamespace)
{
// build step
Axis axis = new Axis(Axis.CHILD);
NodeTest nodeTest=new NodeTest(fStringPool,prefix,uri);
Step step = new Step(axis, nodeTest);
stepsVector.addElement(step);
break;
}
token = xtokens.getToken(++i);
int localpart = xtokens.getTokenString(token);
int rawname = prefix != -1
? fStringPool.addSymbol(fStringPool.toString(prefix) + ':' + fStringPool.toString(localpart))
: localpart;
// build step
Axis axis = new Axis(Axis.CHILD);
NodeTest nodeTest = new NodeTest(fStringPool, new QName(prefix, localpart, rawname, uri));
Step step = new Step(axis, nodeTest);
stepsVector.addElement(step);
firstTokenOfLocationPath=false;
break;
}