tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kin...@apache.org
Subject cvs commit: jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler PageDataImpl.java
Date Tue, 12 Aug 2003 18:12:54 GMT
kinman      2003/08/12 11:12:54

  Modified:    jasper2/src/share/org/apache/jasper/compiler
                        PageDataImpl.java
  Log:
  - Get the logic for resetDefaultNS right.  What was I thinking :-)
  
  Revision  Changes    Path
  1.34      +18 -9     jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/PageDataImpl.java
  
  Index: PageDataImpl.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/PageDataImpl.java,v
  retrieving revision 1.33
  retrieving revision 1.34
  diff -u -r1.33 -r1.34
  --- PageDataImpl.java	12 Aug 2003 01:58:54 -0000	1.33
  +++ PageDataImpl.java	12 Aug 2003 18:12:54 -0000	1.34
  @@ -407,13 +407,13 @@
   
   	public void visit(Node.CustomTag n) throws JasperException {
   	    boolean resetDefaultNSSave = resetDefaultNS;
  -	    appendTag(n);
  +	    appendTag(n, resetDefaultNS);
   	    resetDefaultNS = resetDefaultNSSave;
   	}
   
   	public void visit(Node.UninterpretedTag n) throws JasperException {
   	    boolean resetDefaultNSSave = resetDefaultNS;
  -	    appendTag(n);
  +	    appendTag(n, resetDefaultNS);
   	    resetDefaultNS = resetDefaultNSSave;
   	}
   
  @@ -453,6 +453,15 @@
   	 * Appends the given tag, including its body, to the XML view.
   	 */
   	private void appendTag(Node n) throws JasperException {
  +	    appendTag(n, false);
  +	}
  +
  +	/*
  +	 * Appends the given tag, including its body, to the XML view,
  +	 * and optionally reset default namespace to "", if none specified.
  +	 */
  +	private void appendTag(Node n, boolean addDefaultNS)
  +		throws JasperException {
   
   	    Node.Nodes body = n.getBody();
   	    String text = n.getText();
  @@ -460,7 +469,7 @@
   	    buf.append("<").append(n.getQName());
   	    buf.append("\n");
   
  -	    printAttributes(n);
  +	    printAttributes(n, addDefaultNS);
   	    buf.append("  ").append(jspIdPrefix).append(":id").append("=\"");
   	    buf.append(jspId++).append("\"\n");
   
  @@ -682,7 +691,7 @@
   	/*
   	 * Appends the attributes of the given Node to the XML view.
   	 */
  -	private void printAttributes(Node n) {
  +	private void printAttributes(Node n, boolean addDefaultNS) {
   
   	    /*
   	     * Append "xmlns" attributes that represent tag libraries
  @@ -707,10 +716,10 @@
   		buf.append("  ").append(name).append("=\"").append(value).append("\"\n");
   		defaultNSSeen |= "xmlns".equals(name);
   	    }
  -	    if (resetDefaultNS && !defaultNSSeen) {
  +	    if (addDefaultNS && !defaultNSSeen) {
   		buf.append("  xmlns=\"\"\n");
  -		resetDefaultNS = false;
   	    }
  +	    resetDefaultNS = false;
   
   	    /*
   	     * Append all other attributes
  
  
  

Mime
View raw message