com.sun.org.apache.xpath.internal.objects.XObject.nodelist()方法的使用及代码示例

x33g5p2x  于2022-02-03 转载在 其他  
字(6.8k)|赞(0)|评价(0)|浏览(175)

本文整理了Java中com.sun.org.apache.xpath.internal.objects.XObject.nodelist()方法的一些代码示例,展示了XObject.nodelist()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XObject.nodelist()方法的具体详情如下:
包路径:com.sun.org.apache.xpath.internal.objects.XObject
类名称:XObject
方法名:nodelist

XObject.nodelist介绍

[英]Cast result object to a nodelist. Always issues an error.
[中]将结果对象强制转换为节点列表。总是发出错误。

代码示例

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.jaxp-ri

/**
 *  Use an XPath string to select a nodelist.
 *  XPath namespace prefixes are resolved from the namespaceNode.
 *
 *  @param contextNode The node to start searching from.
 *  @param str A valid XPath string.
 *  @param namespaceNode The node from which prefixes in the XPath will be resolved to namespaces.
 *  @return A NodeIterator, should never be null.
 *
 * @throws TransformerException
 */
public static NodeList selectNodeList(
    Node contextNode, String str, Node namespaceNode)
     throws TransformerException
{
 // Execute the XPath, and have it return the result
 XObject list = eval(contextNode, str, namespaceNode);
 // Return a NodeList.
 return list.nodelist();
}

代码示例来源:origin: com.sun.xml.parsers/jaxp-ri

/**
 *  Use an XPath string to select a nodelist.
 *  XPath namespace prefixes are resolved from the namespaceNode.
 *
 *  @param contextNode The node to start searching from.
 *  @param str A valid XPath string.
 *  @param namespaceNode The node from which prefixes in the XPath will be resolved to namespaces.
 *  @return A NodeIterator, should never be null.
 *
 * @throws TransformerException
 */
public static NodeList selectNodeList(
    Node contextNode, String str, Node namespaceNode)
     throws TransformerException
{
 // Execute the XPath, and have it return the result
 XObject list = eval(contextNode, str, namespaceNode);
 // Return a NodeList.
 return list.nodelist();
}

代码示例来源:origin: com.sun.xml.parsers/jaxp-ri

/**
 *  Use an XPath string to select a nodelist.
 *  XPath namespace prefixes are resolved from the namespaceNode.
 *
 *  @param contextNode The node to start searching from.
 *  @param str A valid XPath string.
 *  @param namespaceNode The node from which prefixes in the XPath will be resolved to namespaces.
 *  @return A NodeIterator, should never be null.
 *
 * @throws TransformerException
 */
public  NodeList selectNodeList(
    Node contextNode, String str, Node namespaceNode)
     throws TransformerException
{
 // Execute the XPath, and have it return the result
 XObject list = eval(contextNode, str, namespaceNode);
 // Return a NodeList.
 return list.nodelist();
}

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.jaxp-ri

/**
 *  Use an XPath string to select a nodelist.
 *  XPath namespace prefixes are resolved from the namespaceNode.
 *
 *  @param contextNode The node to start searching from.
 *  @param str A valid XPath string.
 *  @param namespaceNode The node from which prefixes in the XPath will be resolved to namespaces.
 *  @return A NodeIterator, should never be null.
 *
 * @throws TransformerException
 */
public  NodeList selectNodeList(
    Node contextNode, String str, Node namespaceNode)
     throws TransformerException
{
 // Execute the XPath, and have it return the result
 XObject list = eval(contextNode, str, namespaceNode);
 // Return a NodeList.
 return list.nodelist();
}

代码示例来源:origin: org.glassfish.web/jstl-impl

return resultObject.nodelist();
  return resultObject.nodelist();
else 
  return resultObject.object();

代码示例来源:origin: javax.servlet/com.springsource.javax.servlet.jsp.jstl

return resultObject.nodelist();
  return resultObject.nodelist();
else 
  return resultObject.object();

代码示例来源:origin: org.eclipse.jetty.orbit/org.apache.taglibs.standard.glassfish

return resultObject.nodelist();
  return resultObject.nodelist();
else 
  return resultObject.object();

代码示例来源:origin: org.bluestemsoftware.open.maven.tparty/jsp-api-2.1

return resultObject.nodelist();
  return resultObject.nodelist();
else 
  return resultObject.object();

代码示例来源:origin: com.sun.xml.parsers/jaxp-ri

return resultObject.nodelist();

代码示例来源:origin: com.sun.xml.parsers/jaxp-ri

private Object getResultAsType( XObject resultObject, QName returnType )
  throws javax.xml.transform.TransformerException {
  // XPathConstants.STRING
  if ( returnType.equals( XPathConstants.STRING ) ) { 
    return resultObject.str();
  }
  // XPathConstants.NUMBER
  if ( returnType.equals( XPathConstants.NUMBER ) ) { 
    return new Double ( resultObject.num());
  }
  // XPathConstants.BOOLEAN
  if ( returnType.equals( XPathConstants.BOOLEAN ) ) { 
    return new Boolean( resultObject.bool());
  }
  // XPathConstants.NODESET ---ORdered, UNOrdered???
  if ( returnType.equals( XPathConstants.NODESET ) ) { 
    return resultObject.nodelist();
  }
  // XPathConstants.NODE
  if ( returnType.equals( XPathConstants.NODE ) ) { 
    NodeIterator ni = resultObject.nodeset(); 
    //Return the first node, or null
    return ni.nextNode();
  }
  String fmsg = XSLMessages.createXPATHMessage(
      XPATHErrorResources.ER_UNSUPPORTED_RETURN_TYPE,
      new Object[] { returnType.toString()});
  throw new IllegalArgumentException( fmsg );
}

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.jaxp-ri

private Object getResultAsType( XObject resultObject, QName returnType )
  throws javax.xml.transform.TransformerException {
  // XPathConstants.STRING
  if ( returnType.equals( XPathConstants.STRING ) ) { 
    return resultObject.str();
  }
  // XPathConstants.NUMBER
  if ( returnType.equals( XPathConstants.NUMBER ) ) { 
    return new Double ( resultObject.num());
  }
  // XPathConstants.BOOLEAN
  if ( returnType.equals( XPathConstants.BOOLEAN ) ) { 
    return new Boolean( resultObject.bool());
  }
  // XPathConstants.NODESET ---ORdered, UNOrdered???
  if ( returnType.equals( XPathConstants.NODESET ) ) { 
    return resultObject.nodelist();
  }
  // XPathConstants.NODE
  if ( returnType.equals( XPathConstants.NODE ) ) { 
    NodeIterator ni = resultObject.nodeset(); 
    //Return the first node, or null
    return ni.nextNode();
  }
  String fmsg = XSLMessages.createXPATHMessage(
      XPATHErrorResources.ER_UNSUPPORTED_RETURN_TYPE,
      new Object[] { returnType.toString()});
  throw new IllegalArgumentException( fmsg );
}

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.jaxp-ri

return resultObject.nodelist();

代码示例来源:origin: io.snappydata/gemfirexd

nodeList = xOb.nodelist();
numItems = nodeList.getLength();

代码示例来源:origin: io.snappydata/gemfirexd-core

nodeList = xOb.nodelist();
numItems = nodeList.getLength();

代码示例来源:origin: com.ibm.sbt/com.ibm.commons.xml

final NodeList nl = object.nodelist();
final int len = nl.getLength(); 
if(len==0) {

代码示例来源:origin: com.ibm.sbt/com.ibm.commons.xml

final NodeList nl = object.nodelist();
final int len = nl.getLength(); 
if(len==0) {

代码示例来源:origin: com.ibm.sbt/com.ibm.commons.xml

throw new XPathException(null,"XPath result cannot contain both values and nodes"); // $NLS-AbstractXercesDriver.AnXPathresultcannotcontainbothval.3-1$
NodeList nl = res.nodelist();
int len = nl.getLength(); 
if(len>0) {

代码示例来源:origin: com.ibm.sbt/com.ibm.commons.xml

throw new XPathException(null,"XPath result cannot contain both values and nodes"); // $NLS-AbstractXercesDriver.AnXPathresultcannotcontainbothval.3-1$
NodeList nl = res.nodelist();
int len = nl.getLength(); 
if(len>0) {

代码示例来源:origin: com.sun.xml.parsers/jaxp-ri

(m_resultType == ORDERED_NODE_SNAPSHOT_TYPE)) {
try {       	
  m_list = m_resultObj.nodelist();
} catch (TransformerException te) {

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.jaxp-ri

(m_resultType == ORDERED_NODE_SNAPSHOT_TYPE)) {
try {       	
  m_list = m_resultObj.nodelist();
} catch (TransformerException te) {

相关文章