Examples of ElemTemplateElement


Examples of org.apache.xalan.templates.ElemTemplateElement

   * @return The current xsl:template, should not be null.
   */
  public ElemTemplate getCurrentTemplate()
  {

    ElemTemplateElement elem = getCurrentElement();

    while ((null != elem)
           && (elem.getXSLToken() != Constants.ELEMNAME_TEMPLATE))
    {
      elem = elem.getParentElem();
    }

    return (ElemTemplate) elem;
  }
View Full Code Here

Examples of org.apache.xalan.templates.ElemTemplateElement

    }
  }
 
  private double getElemVersion()
  {
    ElemTemplateElement elem = getElemTemplateElement();
    double version = -1;
    while ((version == -1 || version == Constants.XSLTVERSUPPORTED) && elem != null)
    {
      try{
      version = Double.valueOf(elem.getVersion()).doubleValue();
      }
      catch (Exception ex)
      {
        version = -1;
      }
      elem = elem.getParentElem();
      }
    return (version == -1)? Constants.XSLTVERSUPPORTED : version;
  }
View Full Code Here

Examples of org.apache.xalan.templates.ElemTemplateElement

   */
  public void executeFromSnapshot(TransformSnapshot ts)
          throws TransformerException
  {

    ElemTemplateElement template = getMatchedTemplate();
    int child = getMatchedNode();

    pushElemTemplateElement(template)//needed??
    m_xcontext.pushCurrentNode(child)//needed??
    this.executeChildTemplates(template, true)// getResultTreeHandler());
View Full Code Here

Examples of org.apache.xalan.templates.ElemTemplateElement

    }
  }
 
  private double getElemVersion()
  {
    ElemTemplateElement elem = getElemTemplateElement();
    double version = -1;
    while ((version == -1 || version == Constants.XSLTVERSUPPORTED) && elem != null)
    {
      try{
      version = Double.valueOf(elem.getXmlVersion()).doubleValue();
      }
      catch (Exception ex)
      {
        version = -1;
      }
      elem = elem.getParentElem();
      }
    return (version == -1)? Constants.XSLTVERSUPPORTED : version;
  }
View Full Code Here

Examples of org.apache.xalan.templates.ElemTemplateElement

   * @xsl.usage advanced
   */
  public String transformToString(ElemTemplateElement elem)
          throws TransformerException
  {
    ElemTemplateElement firstChild = elem.getFirstChildElem();
    if(null == firstChild)
      return "";
    if(elem.hasTextLitOnly() && m_optimizer)
    {
      return ((ElemTextLiteral)firstChild).getNodeValue();
View Full Code Here

Examples of org.apache.xalan.templates.ElemTemplateElement

          ElemTemplateElement elem, boolean shouldAddAttrs)
            throws TransformerException
  {

    // Does this element have any children?
    ElemTemplateElement t = elem.getFirstChildElem();

    if (null == t)
      return;     
   
    if(elem.hasTextLitOnly() && m_optimizer)
    {     
      char[] chars = ((ElemTextLiteral)t).getChars();
      try
      {
        // Have to push stuff on for tooling...
        this.pushElemTemplateElement(t);
        m_serializationHandler.characters(chars, 0, chars.length);
      }
      catch(SAXException se)
      {
        throw new TransformerException(se);
      }
      finally
      {
        this.popElemTemplateElement();
      }
      return;
    }

//    // Check for infinite loops if we have to.
//    boolean check = (m_stackGuard.m_recursionLimit > -1);
//
//    if (check)
//      getStackGuard().push(elem, xctxt.getCurrentNode());

    XPathContext xctxt = m_xcontext;
    xctxt.pushSAXLocatorNull();
    int currentTemplateElementsTop = m_currentTemplateElements.size();
    m_currentTemplateElements.push(null);

    try
    {
      // Loop through the children of the template, calling execute on
      // each of them.
      for (; t != null; t = t.getNextSiblingElem())
      {
        if (!shouldAddAttrs
                && t.getXSLToken() == Constants.ELEMNAME_ATTRIBUTE)
          continue;

        xctxt.setSAXLocator(t);
        m_currentTemplateElements.setElementAt(t,currentTemplateElementsTop);
        t.execute(this);
      }
    }
    catch(RuntimeException re)
    {
      TransformerException te = new TransformerException(re);
View Full Code Here

Examples of org.apache.xalan.templates.ElemTemplateElement

  {
    Vector elems = new Vector();
    int nStackSize = m_currentTemplateElements.size();
    for(int i = 0; i < nStackSize; i++)
    {
      ElemTemplateElement elem = (ElemTemplateElement) m_currentTemplateElements.elementAt(i);
      if(null != elem)
      {
        elems.addElement(elem);
      }
    }
View Full Code Here

Examples of org.apache.xalan.templates.ElemTemplateElement

  {
    Vector elems = new Vector();
    int nStackSize = m_currentTemplateElements.size();
    for(int i = 0; i < nStackSize; i++)
    {
      ElemTemplateElement elem = (ElemTemplateElement) m_currentTemplateElements.elementAt(i);
      if(null != elem && (elem.getXSLToken() != Constants.ELEMNAME_TEMPLATE))
      {
        elems.addElement(elem);
      }
    }
    return elems;
View Full Code Here

Examples of org.apache.xalan.templates.ElemTemplateElement

   * @return The current xsl:template, should not be null.
   */
  public ElemTemplate getCurrentTemplate()
  {

    ElemTemplateElement elem = getCurrentElement();

    while ((null != elem)
           && (elem.getXSLToken() != Constants.ELEMNAME_TEMPLATE))
    {
      elem = elem.getParentElem();
    }

    return (ElemTemplate) elem;
  }
View Full Code Here

Examples of org.apache.xalan.templates.ElemTemplateElement

   */
  public void executeFromSnapshot(TransformSnapshot ts)
          throws TransformerException
  {

    ElemTemplateElement template = getMatchedTemplate();
    int child = getMatchedNode();

    pushElemTemplateElement(template)//needed??
    m_xcontext.pushCurrentNode(child)//needed??
    this.executeChildTemplates(template, true)// getResultTreeHandler());
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.