Package org.exist.xslt.expression

Examples of org.exist.xslt.expression.Template


  public void analyze(AnalyzeContextInfo contextInfo) throws XPathException {
    super.analyze(contextInfo);

    for (Expression expr : steps) {
      if (expr instanceof Template) {
        Template template = (Template) expr;
        if (template.isRootMatch()) {
          if (rootTemplate != null) {
            if (template.isPrioritySet() || rootTemplate.isPrioritySet()) {
              if (template.getPriority() == rootTemplate.getPriority()) {
                compileError("double root match");//XXX: put error code
              } else if (template.getPriority() > rootTemplate.getPriority()) {
                rootTemplate = template;
              }
              continue;
            }
            compileError("double root match");//XXX: put error code
          }
          rootTemplate = template;

          if (template.getName() != null)
            namedTemplates.put(template.getName(), template);//UNDERSTAND: check doubles?

        } else if (template.getName() == null) {
          templates.add(template);
        } else {
          namedTemplates.put(template.getName(), template);//UNDERSTAND: check doubles?
        }
      } else if (expr instanceof AttributeSet) {
        AttributeSet attributeSet = (AttributeSet) expr;
        if (attributeSets.containsKey(attributeSet.getName()))
          attributeSets.get(attributeSet.getName()).add(attributeSet);
View Full Code Here


    if (contextItem != null)
      currentSequence = contextItem.toSequence();

    int pos = context.getContextPosition();

    Template template = namedTemplates.get(name);
    for (SequenceIterator iterInner = currentSequence.iterate(); iterInner.hasNext();) {
      Item item = iterInner.nextItem();  
     
      //UNDERSTAND: work around
//      if (item instanceof org.w3c.dom.Document) {
//        org.w3c.dom.Document document = (org.w3c.dom.Document) item;
//        item = (Item) document.getDocumentElement();
//      }
     
      context.setContextSequencePosition(pos, currentSequence);

      Sequence res = template.eval(contextSequence, item);
      result.addAll(res);
      if (res.getItemCount() > 0)
        break;

      pos++;
View Full Code Here

TOP

Related Classes of org.exist.xslt.expression.Template

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.