本文整理汇总了Java中com.sun.org.apache.xpath.internal.objects.XNodeSet.setRoot方法的典型用法代码示例。如果您正苦于以下问题:Java XNodeSet.setRoot方法的具体用法?Java XNodeSet.setRoot怎么用?Java XNodeSet.setRoot使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.sun.org.apache.xpath.internal.objects.XNodeSet
的用法示例。
在下文中一共展示了XNodeSet.setRoot方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: execute
import com.sun.org.apache.xpath.internal.objects.XNodeSet; //导入方法依赖的package包/类
/**
* Execute this iterator, meaning create a clone that can
* store state, and initialize it for fast execution from
* the current runtime state. When this is called, no actual
* query from the current context node is performed.
*
* @param xctxt The XPath execution context.
*
* @return An XNodeSet reference that holds this iterator.
*
* @throws javax.xml.transform.TransformerException
*/
public XObject execute(XPathContext xctxt)
throws javax.xml.transform.TransformerException
{
XNodeSet iter = new XNodeSet((LocPathIterator)m_clones.getInstance());
iter.setRoot(xctxt.getCurrentNode(), xctxt);
return iter;
}
示例2: asIterator
import com.sun.org.apache.xpath.internal.objects.XNodeSet; //导入方法依赖的package包/类
/**
* Given an select expression and a context, evaluate the XPath
* and return the resulting iterator.
*
* @param xctxt The execution context.
* @param contextNode The node that "." expresses.
* @throws TransformerException thrown if the active ProblemListener decides
* the error condition is severe enough to halt processing.
*
* @throws javax.xml.transform.TransformerException
* @xsl.usage experimental
*/
public DTMIterator asIterator(
XPathContext xctxt, int contextNode)
throws javax.xml.transform.TransformerException
{
XNodeSet iter = new XNodeSet((LocPathIterator)m_clones.getInstance());
iter.setRoot(contextNode, xctxt);
return iter;
}