tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From craig...@apache.org
Subject cvs commit: jakarta-tomcat-4.0/jasper/src/share/org/apache/jasper/compiler ParserXJspSaxHandler.java
Date Wed, 12 Sep 2001 20:25:35 GMT
craigmcc    01/09/12 13:25:35

  Modified:    jasper/src/share/org/apache/jasper/compiler
                        ParserXJspSaxHandler.java
  Log:
  Fix for Bugzilla #3350 (character data was rearranged in output).  Patch
  by Kin-Man Chung <kin-man.chung@sun.com>
  
  PR: Bugzilla #3350
  Submitted by:	Mark Abbott <mark.abbott@openwave.com>
  
  Revision  Changes    Path
  1.14      +17 -2     jakarta-tomcat-4.0/jasper/src/share/org/apache/jasper/compiler/ParserXJspSaxHandler.java
  
  Index: ParserXJspSaxHandler.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-4.0/jasper/src/share/org/apache/jasper/compiler/ParserXJspSaxHandler.java,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- ParserXJspSaxHandler.java	2001/04/27 18:09:31	1.13
  +++ ParserXJspSaxHandler.java	2001/09/12 20:25:35	1.14
  @@ -233,8 +233,9 @@
   
           // If previous node is a custom tag, call its
           // begin tag handler
  -        if (!name.equals("jsp:root")) {
  -            Node prevNode = (Node)stack.peek();
  +        Node prevNode = null;
  +        if (!stack.empty()) {
  +            prevNode = (Node) stack.peek();
               if (prevNode instanceof NodeTag) {
                   try {
                       processCustomTagBeginDoIt((NodeTag) prevNode, true);
  @@ -273,6 +274,16 @@
   		}
   		if (!isCustomTag) {
   		    // uninterpreted tag
  +                    // If the parent tag is also uninterpreted, then the
  +                    // characters have to be flushed, to preserve the order
  +                    // of the tags and characters that may appear in a XML
  +                    // fragment, such as <a>xyz<b></b></a>.
  +                    if ((prevNode != null) && prevNode.isUninterpretedTag() &&
  +                        (prevNode.getText() != null)) {
  +                        jspHandler.handleCharData(prevNode.start, start,
  +                                                  prevNode.getText());
  +                        prevNode.clearText();
  +                    }
   		    node.setUninterpreted(true);
   		    jspHandler.handleUninterpretedTagBegin(node.start, 
                               node.start, node.rawName, node.attrs);
  @@ -645,6 +656,10 @@
               return text == null 
   	    ? null
   	    : text.toString().toCharArray();
  +        }
  +
  +        void clearText() {
  +            text = null;
           }
   
   	boolean isRoot() {
  
  
  

Mime
View raw message