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

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

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

XObject.create介绍

[英]Create the right XObject based on the type of the object passed. This function can not make an XObject that exposes DOM Nodes, NodeLists, and NodeIterators to the XSLT stylesheet as node-sets.
[中]根据传递的对象类型创建右XObject。此函数不能生成将DOM节点、节点列表和节点编辑器作为节点集公开给XSLT样式表的XObject。

代码示例

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

public XObject getVariableOrParam(XPathContext xctxt, QName qname)
  throws TransformerException,IllegalArgumentException {
  if ( qname == null ) {
    //JAXP 1.3 spec says that if variable name is null then 
    // we need to through IllegalArgumentException
    String fmsg = XSLMessages.createXPATHMessage( 
      XPATHErrorResources.ER_ARG_CANNOT_BE_NULL,
      new Object[] {"Variable qname"} );
    throw new IllegalArgumentException( fmsg );
  }
javax.xml.namespace.QName name =
  new javax.xml.namespace.QName(
      qname.getNamespace(),
      qname.getLocalPart());
  Object varValue = resolver.resolveVariable( name );        
  if ( varValue == null ) {
    String fmsg = XSLMessages.createXPATHMessage( 
      XPATHErrorResources.ER_RESOLVE_VARIABLE_RETURNS_NULL,
      new Object[] { name.toString()} );
    throw new TransformerException( fmsg );
  } 
  return XObject.create( varValue, xctxt );
}

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

public XObject getVariableOrParam(XPathContext xctxt, QName qname)
  throws TransformerException,IllegalArgumentException {
  if ( qname == null ) {
    //JAXP 1.3 spec says that if variable name is null then 
    // we need to through IllegalArgumentException
    String fmsg = XSLMessages.createXPATHMessage( 
      XPATHErrorResources.ER_ARG_CANNOT_BE_NULL,
      new Object[] {"Variable qname"} );
    throw new IllegalArgumentException( fmsg );
  }
javax.xml.namespace.QName name =
  new javax.xml.namespace.QName(
      qname.getNamespace(),
      qname.getLocalPart());
  Object varValue = resolver.resolveVariable( name );        
  if ( varValue == null ) {
    String fmsg = XSLMessages.createXPATHMessage( 
      XPATHErrorResources.ER_RESOLVE_VARIABLE_RETURNS_NULL,
      new Object[] { name.toString()} );
    throw new TransformerException( fmsg );
  } 
  return XObject.create( varValue, xctxt );
}

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

result = XObject.create(val, xctxt);

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

result = XObject.create(val, xctxt);

相关文章