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


Java ElemTemplateElement.getFirstChildElem方法代码示例

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


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

示例1: validate

import org.apache.xalan.templates.ElemTemplateElement; //导入方法依赖的package包/类
/**
  * Non-recursive traversal of FunctionElement tree based on TreeWalker to verify that
  * there are no literal result elements except within a func:result element and that
  * the func:result element does not contain any following siblings except xsl:fallback.
  */
 public void validate(ElemTemplateElement elem, StylesheetHandler handler)
   throws SAXException
 {
   String msg = "";
   while (elem != null)
   { 
     //System.out.println("elem " + elem);
     if (elem instanceof ElemExsltFuncResult 
         && elem.getNextSiblingElem() != null 
         && !(elem.getNextSiblingElem() instanceof ElemFallback))
     {
       msg = "func:result has an illegal following sibling (only xsl:fallback allowed)";
       handler.error(msg, new SAXException(msg));
     }
     
     if((elem instanceof ElemApplyImport
 || elem instanceof ElemApplyTemplates
 || elem instanceof ElemAttribute
 || elem instanceof ElemCallTemplate
 || elem instanceof ElemComment
 || elem instanceof ElemCopy
 || elem instanceof ElemCopyOf
 || elem instanceof ElemElement
 || elem instanceof ElemLiteralResult
 || elem instanceof ElemNumber
 || elem instanceof ElemPI
 || elem instanceof ElemText
 || elem instanceof ElemTextLiteral
 || elem instanceof ElemValueOf)
&& !(ancestorIsOk(elem)))
     {
       msg ="misplaced literal result in a func:function container.";
       handler.error(msg, new SAXException(msg));
     }
     ElemTemplateElement nextElem = elem.getFirstChildElem();
     while (nextElem == null)
     {
       nextElem = elem.getNextSiblingElem();
       if (nextElem == null)
         elem = elem.getParentElem();
       if (elem == null || elem instanceof ElemExsltFunction)
         return; // ok
     }  
     elem = nextElem;
   }
 }
 
开发者ID:keplersj,项目名称:In-the-Box-Fork,代码行数:52,代码来源:ProcessorExsltFunction.java


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