Examples of ElemTemplateElement


Examples of org.apache.xalan.templates.ElemTemplateElement

    {
      return false;
    }
    else
    {
      ElemTemplateElement elem = m_stylesheet.getFirstChildElem();
      while (elem != null && elem != m_stylesheet)
      {
        if (elem instanceof ElemExsltFuncResult && ancestorIsFunction(elem))
          return true;
        ElemTemplateElement  nextElem = elem.getFirstChildElem();
        if (nextElem == null)
          nextElem = elem.getNextSiblingElem();
        if (nextElem == null)
          nextElem = elem.getParentElem();
        elem = nextElem;
View Full Code Here

Examples of org.apache.xalan.templates.ElemTemplateElement

  private ElemTemplate getNextMatchOrNamedTemplate(int pos)
  {
    ObjectStack elems = m_transformer.getCurrentTemplateElements();
    for (int i = pos; i >= 0; i--)
    {
      ElemTemplateElement elem = (ElemTemplateElement) elems.elementAt(i);
      if(null != elem)
      {
        if(elem.getXSLToken() == Constants.ELEMNAME_TEMPLATE)
        {
          return (ElemTemplate)elem;
        }
      }
    }
View Full Code Here

Examples of org.apache.xalan.templates.ElemTemplateElement

   */
public void selected(SelectionEvent ev)
    throws javax.xml.transform.TransformerException {

    if (m_traceSelection) {
        ElemTemplateElement ete = (ElemTemplateElement) ev.m_styleNode;
        Node sourceNode = ev.m_sourceNode;

        SourceLocator locator = null;
        if (sourceNode instanceof DTMNodeProxy) {
            int nodeHandler = ((DTMNodeProxy) sourceNode).getDTMNodeNumber();
            locator =
                ((DTMNodeProxy) sourceNode).getDTM().getSourceLocatorFor(
                    nodeHandler);
        }

        if (locator != null)
            m_pw.println(
                "Selected source node '"
                    + sourceNode.getNodeName()
                    + "', at "
                    + locator);
        else
            m_pw.println(
                "Selected source node '" + sourceNode.getNodeName() + "'");

        if (ev.m_styleNode.getLineNumber() == 0) {

            // You may not have line numbers if the selection is occuring from a
            // default template.
            ElemTemplateElement parent =
                (ElemTemplateElement) ete.getParentElem();

            if (parent == ete.getStylesheetRoot().getDefaultRootRule()) {
                m_pw.print("(default root rule) ");
            } else if (
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

Examples of org.apache.xalan.templates.ElemTemplateElement

  public void endElement(
          StylesheetHandler handler, String uri, String localName, String rawName)
            throws org.xml.sax.SAXException
  {

    ElemTemplateElement elem = handler.getElemTemplateElement();

    if (elem instanceof ElemLiteralResult)
    {
      if (((ElemLiteralResult) elem).getIsLiteralResultAsStylesheet())
      {
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.