Package org.apache.xalan.templates

Examples of org.apache.xalan.templates.ElemTemplate


          //else
            throw new org.xml.sax.SAXException(msg, e);
        }
        handler.pushElemTemplateElement(stylesheet);

        ElemTemplate template = new ElemTemplate();

        appendAndPush(handler, template);

        XPath rootMatch = new XPath("/", stylesheet, stylesheet, XPath.MATCH,
             handler.getStylesheetProcessor().getErrorListener());

        template.setMatch(rootMatch);

        // template.setDOMBackPointer(handler.getOriginatingNode());
        stylesheet.setTemplate(template);

        p = handler.getElemTemplateElement();
View Full Code Here


     
    // loop from the top index down to the recursion limit (I don't think
    // there's any need to go below that).
    for (int i = (nTemplates - 1); i >= m_recursionLimit; i--)
    {
      ElemTemplate template = getNextMatchOrNamedTemplate(i);
     
      if(null == template)
        break;
       
      int loopCount = countLikeTemplates(template, i);
     
      if (loopCount >= m_recursionLimit)
      {
        // throw new TransformerException("Template nesting too deep. nesting = "+loopCount+
        //   ", template "+((null == template.getName()) ? "name = " : "match = ")+
        //   ((null != template.getName()) ? template.getName().toString()
        //   : template.getMatch().getPatternString()));
       
        String idIs = XSLMessages.createMessage(((null != template.getName()) ? "nameIs" : "matchPatternIs"), null);
          Object[] msgArgs = new Object[]{ new Integer(loopCount), idIs,
                     ((null != template.getName()) ? template.getName().toString()
           : template.getMatch().getPatternString()) };
          String msg = XSLMessages.createMessage("recursionTooDeep", msgArgs);

        throw new TransformerException(msg);
      }
    }
View Full Code Here

   * the function, null if none exists.
   */
  public ElemExsltFunction getFunction(String funcName)
  {
    QName qname = new QName(m_namespace, funcName);
    ElemTemplate templ = m_stylesheet.getTemplateComposed(qname);
    if (templ != null && templ instanceof ElemExsltFunction)
      return (ElemExsltFunction) templ;
    else
      return null;   
  }
View Full Code Here

    while (parent != null && !(parent instanceof ElemTemplate))
    {
      parent = parent.exprGetParent();
    }
   
    ElemTemplate callerTemplate = (parent != null) ? (ElemTemplate)parent: null;
   
    XObject[] methodArgs;
    methodArgs = new XObject[args.size()];
    try
    {
View Full Code Here

     
    // loop from the top index down to the recursion limit (I don't think
    // there's any need to go below that).
    for (int i = (nTemplates - 1); i >= m_recursionLimit; i--)
    {
      ElemTemplate template = getNextMatchOrNamedTemplate(i);
     
      if(null == template)
        break;
       
      int loopCount = countLikeTemplates(template, i);
     
      if (loopCount >= m_recursionLimit)
      {
        // throw new TransformerException("Template nesting too deep. nesting = "+loopCount+
        //   ", template "+((null == template.getName()) ? "name = " : "match = ")+
        //   ((null != template.getName()) ? template.getName().toString()
        //   : template.getMatch().getPatternString()));
       
        String idIs = XSLMessages.createMessage(((null != template.getName()) ? "nameIs" : "matchPatternIs"), null);
          Object[] msgArgs = new Object[]{ new Integer(loopCount), idIs,
                     ((null != template.getName()) ? template.getName().toString()
           : template.getMatch().getPatternString()) };
          String msg = XSLMessages.createMessage("recursionTooDeep", msgArgs);

        throw new TransformerException(msg);
      }
    }
View Full Code Here

      }
      break;
    case Constants.ELEMNAME_TEMPLATE :
      if (m_traceTemplates || m_traceElements)
      {
        ElemTemplate et = (ElemTemplate) ev.m_styleNode;

        m_pw.print(et.getSystemId()+ " Line #" + et.getLineNumber() + ", " + "Column #"
                   + et.getColumnNumber() + ": " + et.getNodeName() + " ");

        if (null != et.getMatch())
        {
          m_pw.print("match='" + et.getMatch().getPatternString() + "' ");
        }

        if (null != et.getName())
        {
          m_pw.print("name='" + et.getName() + "' ");
        }

        m_pw.println();
      }
      break;
View Full Code Here

            throw new org.xml.sax.SAXException(e);
                    }
        }
        handler.pushElemTemplateElement(stylesheet);

        ElemTemplate template = new ElemTemplate();
        if (slocator != null)
            template.setLocaterInfo(slocator);

        appendAndPush(handler, template);

        XPath rootMatch = new XPath("/", stylesheet, stylesheet, XPath.MATCH,
             handler.getStylesheetProcessor().getErrorListener());

        template.setMatch(rootMatch);

        // template.setDOMBackPointer(handler.getOriginatingNode());
        stylesheet.setTemplate(template);

        p = handler.getElemTemplateElement();
View Full Code Here

          //else
            throw new org.xml.sax.SAXException(msg, e);
        }
        handler.pushElemTemplateElement(stylesheet);

        ElemTemplate template = new ElemTemplate();

        appendAndPush(handler, template);

        XPath rootMatch = new XPath("/", stylesheet, stylesheet, XPath.MATCH,
             handler.getStylesheetProcessor().getErrorListener());

        template.setMatch(rootMatch);

        // template.setDOMBackPointer(handler.getOriginatingNode());
        stylesheet.setTemplate(template);

        p = handler.getElemTemplateElement();
View Full Code Here

   * the function, null if none exists.
   */
  public ElemExsltFunction getFunction(String funcName)
  {
    QName qname = new QName(m_namespace, funcName);
    ElemTemplate templ = m_stylesheet.getTemplateComposed(qname);
    if (templ != null && templ instanceof ElemExsltFunction)
      return (ElemExsltFunction) templ;
    else
      return null;   
  }
View Full Code Here

    while (parent != null && !(parent instanceof ElemTemplate))
    {
      parent = parent.exprGetParent();
    }
   
    ElemTemplate callerTemplate = (parent != null) ? (ElemTemplate)parent: null;
   
    XObject[] methodArgs;
    methodArgs = new XObject[args.size()];
    try
    {
View Full Code Here

TOP

Related Classes of org.apache.xalan.templates.ElemTemplate

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.