当前位置: 首页>>代码示例>>Java>>正文


Java XPath.getExpression方法代码示例

本文整理汇总了Java中org.apache.xpath.XPath.getExpression方法的典型用法代码示例。如果您正苦于以下问题:Java XPath.getExpression方法的具体用法?Java XPath.getExpression怎么用?Java XPath.getExpression使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.xpath.XPath的用法示例。


在下文中一共展示了XPath.getExpression方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getAnalysisBits

import org.apache.xpath.XPath; //导入方法依赖的package包/类
/** 
 * Get the analysis bits for this walker, as defined in the WalkerFactory.
 * @return One of WalkerFactory#BIT_DESCENDANT, etc.
 */
public int getAnalysisBits()
{
	org.apache.xalan.templates.ElemVariable vvar = getElemVariable();
	if(null != vvar)
	{
		XPath xpath = vvar.getSelect();
		if(null != xpath)
		{
 		Expression expr = xpath.getExpression();
 		if(null != expr && expr instanceof PathComponent)
 		{
 			return ((PathComponent)expr).getAnalysisBits();
 		}
		}
	}
  return WalkerFactory.BIT_FILTER;
}
 
开发者ID:keplersj,项目名称:In-the-Box-Fork,代码行数:22,代码来源:Variable.java

示例2: setSelect

import org.apache.xpath.XPath; //导入方法依赖的package包/类
/**
 * Set the "select" attribute.
 *
 * @param xpath The XPath expression for the "select" attribute.
 */
public void setSelect(XPath xpath)
{
  m_selectExpression = xpath.getExpression();
  
  // The following line is part of the codes added to fix bug#16889
  // Store xpath which will be needed when firing Selected Event
  m_xpath = xpath;    
}
 
开发者ID:keplersj,项目名称:In-the-Box-Fork,代码行数:14,代码来源:ElemForEach.java

示例3: setTemplate

import org.apache.xpath.XPath; //导入方法依赖的package包/类
/**
 * Add a template to the table of named templates and/or the table of templates
 * with match patterns.  This routine should
 * be called in decreasing order of precedence but it checks nonetheless.
 *
 * @param template
 */
public void setTemplate(ElemTemplate template)
{
  XPath matchXPath = template.getMatch();
  
  if (null == template.getName() && null == matchXPath)
  {  
    template.error(XSLTErrorResources.ER_NEED_NAME_OR_MATCH_ATTRIB,
        new Object[]{ "xsl:template" });
  }
  
  if (null != template.getName())
  {
    ElemTemplate existingTemplate = (ElemTemplate) m_namedTemplates.get(template.getName());
    if (null == existingTemplate)
    {
      m_namedTemplates.put(template.getName(), template);
    }
    else
    {
      int existingPrecedence =
                      existingTemplate.getStylesheetComposed().getImportCountComposed();
      int newPrecedence = template.getStylesheetComposed().getImportCountComposed();
      if (newPrecedence > existingPrecedence)
      {
        // This should never happen
        m_namedTemplates.put(template.getName(), template);
      }
      else if (newPrecedence == existingPrecedence)
        template.error(XSLTErrorResources.ER_DUPLICATE_NAMED_TEMPLATE,
                     new Object[]{ template.getName() });
    }
  }

  

  if (null != matchXPath)
  {
    Expression matchExpr = matchXPath.getExpression();

    if (matchExpr instanceof StepPattern)
    {
      insertPatternInTable((StepPattern) matchExpr, template);
    }
    else if (matchExpr instanceof UnionPattern)
    {
      UnionPattern upat = (UnionPattern) matchExpr;
      StepPattern[] pats = upat.getPatterns();
      int n = pats.length;

      for (int i = 0; i < n; i++)
      {
        insertPatternInTable(pats[i], template);
      }
    }
    else
    {

      // TODO: assert error
    }
  }
}
 
开发者ID:keplersj,项目名称:In-the-Box-Fork,代码行数:69,代码来源:TemplateList.java


注:本文中的org.apache.xpath.XPath.getExpression方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。