本文整理汇总了Java中com.sun.org.apache.xpath.internal.axes.PredicatedNodeTest类的典型用法代码示例。如果您正苦于以下问题:Java PredicatedNodeTest类的具体用法?Java PredicatedNodeTest怎么用?Java PredicatedNodeTest使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
PredicatedNodeTest类属于com.sun.org.apache.xpath.internal.axes包,在下文中一共展示了PredicatedNodeTest类的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: execute
import com.sun.org.apache.xpath.internal.axes.PredicatedNodeTest; //导入依赖的package包/类
/**
* Execute the function. The function must return
* a valid object.
* @param xctxt The current execution context.
* @return A valid XObject.
*
* @throws javax.xml.transform.TransformerException
*/
public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException
{
SubContextList subContextList = xctxt.getCurrentNodeList();
int currentNode = DTM.NULL;
if (null != subContextList) {
if (subContextList instanceof PredicatedNodeTest) {
LocPathIterator iter = ((PredicatedNodeTest)subContextList)
.getLocPathIterator();
currentNode = iter.getCurrentContextNode();
} else if(subContextList instanceof StepPattern) {
throw new RuntimeException(XSLMessages.createMessage(
XSLTErrorResources.ER_PROCESSOR_ERROR,null));
}
} else {
// not predicate => ContextNode == CurrentNode
currentNode = xctxt.getContextNode();
}
return new XNodeSet(currentNode, xctxt.getDTMManager());
}