morten      01/10/31 01:47:00

  Modified:    java/src/org/apache/xalan/xsltc/compiler Mode.java
  Log:
  Removed default behaviour of text() and "*" in <xsl:apply-imports/>.
  (this element should not invoke built-ins).
  PR:           bugzilla 1397
  Obtained from:        n/a
  Submitted by: [EMAIL PROTECTED]
  Reviewed by:  [EMAIL PROTECTED]
  
  Revision  Changes    Path
  1.15      +4 -18     
xml-xalan/java/src/org/apache/xalan/xsltc/compiler/Mode.java
  
  Index: Mode.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/Mode.java,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- Mode.java 2001/10/26 08:07:01     1.14
  +++ Mode.java 2001/10/31 09:47:00     1.15
  @@ -1,5 +1,5 @@
   /*
  - * @(#)$Id: Mode.java,v 1.14 2001/10/26 08:07:01 morten Exp $
  + * @(#)$Id: Mode.java,v 1.15 2001/10/31 09:47:00 morten Exp $
    *
    * The Apache Software License, Version 1.1
    *
  @@ -934,16 +934,6 @@
        ifeq.setTarget(ilLoop.append(RETURN)); // applyTemplates() ends here!
        final InstructionHandle ihLoop = ilLoop.getStart();
   
  -     // (*) Compile default handling of elements (traverse children)
  -     InstructionList ilRecurse =
  -         compileDefaultRecursion(classGen, methodGen, ihLoop);
  -     InstructionHandle ihRecurse = ilRecurse.getStart();
  -
  -     // (*) Compile default handling of text/attribute nodes (output text)
  -     InstructionList ilText =
  -         compileDefaultText(classGen, methodGen, ihLoop);
  -     InstructionHandle ihText = ilText.getStart();
  -
        // Distinguish attribute/element/namespace tests for further processing
        final int[] types = new int[DOM.NTYPES + names.size()];
        for (int i = 0; i < types.length; i++) types[i] = i;
  @@ -961,9 +951,9 @@
   
        // (*) Handle template with explicit "*" pattern
        final TestSeq elemTest = _testSeq[DOM.ELEMENT];
  -     InstructionHandle ihElem = ihRecurse;
  +     InstructionHandle ihElem = ihLoop;
        if (elemTest != null)
  -         ihElem = elemTest.compile(classGen, methodGen, ihRecurse);
  +         ihElem = elemTest.compile(classGen, methodGen, ihLoop);
   
        // (*) Handle template with explicit "@*" pattern
        final TestSeq attrTest = _testSeq[DOM.ATTRIBUTE];
  @@ -983,6 +973,7 @@
   
        // (*) If there is a match on node() we need to replace ihElem
        //     and ihText (default behaviour for elements & text).
  +     InstructionHandle ihText = ihLoop;
        if (_nodeTestSeq != null) {
            double nodePrio = -0.5; //_nodeTestSeq.getPriority();
            int    nodePos  = _nodeTestSeq.getPosition();
  @@ -1116,11 +1107,6 @@
        if (nsElem != null) body.append(nsElem);
        // Append NS:@* node tests (if any)
        if (nsAttr != null) body.append(nsAttr);
  -
  -     // Append default action for element and root nodes
  -     body.append(ilRecurse);
  -     // Append default action for text and attribute nodes
  -     body.append(ilText);
   
        // putting together constituent instruction lists
        mainIL.append(new GOTO_W(ihLoop));
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to