Uploaded image for project: 'XalanJ2'
  1. XalanJ2
  2. XALANJ-1007

ElemApplyTemplate not calling pushElemTemplateElement

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 2.4
    • None
    • None
    • Operating System: Linux
      Platform: PC
    • 9124

    Description

      It appears that ElemApplyTemplate calls pushElemTemplateElement for the
      childTemplates of "template", but not the template, itself. Consequently the
      element stack for use by tools is not correct.

      I seemed to have gotten it to work by the mods shown below.

      /************ starting about line 410 in ElemApplyTemplate ******/
      //-amb, was null. Moved from above.
      transformer.pushElemTemplateElement(template);
      // Fire a trace event for the template.
      if (TransformerImpl.S_DEBUG)
      transformer.getTraceManager().fireTraceEvent(template);

      //-amb, added this line (or you could think of adding the above line,
      // as the original line had null as the argument
      transformer.pushElemTemplateElement(null);
      // And execute the child templates.
      // Loop through the children of the template, calling execute on

      // each of them.
      for (ElemTemplateElement t = template.m_firstChild;
      t != null; t = t.m_nextSibling)

      { xctxt.setSAXLocator(t); transformer.setCurrentElement(t); t.execute(transformer); }

      //-amb, added this line. Should it go in the finally block, too?
      transformer.popElemTemplateElement();

      Attachments

        Activity

          People

            Unassigned Unassigned
            byersa@automationgroups.com Al Byers
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated: