本文整理汇总了Java中com.sun.org.apache.xml.internal.dtm.DTM.getFirstChild方法的典型用法代码示例。如果您正苦于以下问题:Java DTM.getFirstChild方法的具体用法?Java DTM.getFirstChild怎么用?Java DTM.getFirstChild使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.sun.org.apache.xml.internal.dtm.DTM
的用法示例。
在下文中一共展示了DTM.getFirstChild方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: asNode
import com.sun.org.apache.xml.internal.dtm.DTM; //导入方法依赖的package包/类
/**
* Return the first node out of the nodeset, if this expression is
* a nodeset expression. This is the default implementation for
* nodesets.
* <p>WARNING: Do not mutate this class from this function!</p>
* @param xctxt The XPath runtime context.
* @return the first node out of the nodeset, or DTM.NULL.
*/
public int asNode(XPathContext xctxt)
throws javax.xml.transform.TransformerException
{
int current = xctxt.getCurrentNode();
DTM dtm = xctxt.getDTM(current);
return dtm.getFirstChild(current);
}
示例2: execute
import com.sun.org.apache.xml.internal.dtm.DTM; //导入方法依赖的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
{
int whereNode = getArg0AsNode(xctxt);
String fileLocation = null;
if (DTM.NULL != whereNode)
{
DTM dtm = xctxt.getDTM(whereNode);
// %REVIEW%
if (DTM.DOCUMENT_FRAGMENT_NODE == dtm.getNodeType(whereNode))
{
whereNode = dtm.getFirstChild(whereNode);
}
if (DTM.NULL != whereNode)
{
fileLocation = dtm.getDocumentBaseURI();
// int owner = dtm.getDocument();
// fileLocation = xctxt.getSourceTreeManager().findURIFromDoc(owner);
}
}
return new XString((null != fileLocation) ? fileLocation : "");
}
示例3: DTMChildIterNodeList
import com.sun.org.apache.xml.internal.dtm.DTM; //导入方法依赖的package包/类
/**
* Public constructor: Create a NodeList to support
* DTMNodeProxy.getChildren().
*
* Unfortunately AxisIterators and DTMIterators don't share an API,
* so I can't use the existing Axis.CHILD iterator. Rather than
* create Yet Another Class, let's set up a special case of this
* one.
*
* @param parentDTM The DTM containing this node
* @param parentHandle DTM node-handle integer
*
*/
public DTMChildIterNodeList(DTM parentDTM,int parentHandle) {
m_parentDTM=parentDTM;
m_firstChild=parentDTM.getFirstChild(parentHandle);
}