You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by di...@apache.org on 2003/01/11 11:47:59 UTC

cvs commit: jakarta-commons-sandbox/jelly/src/java/org/apache/commons/jelly/tags/core FileTag.java

dion        2003/01/11 02:47:59

  Modified:    jelly/src/java/org/apache/commons/jelly/tags/core
                        FileTag.java
  Log:
  Applied patch to allow file tag to specify whether xml should be escaped or not.
  
  Thanks to Robert Leftwich
  
  Revision  Changes    Path
  1.7       +20 -0     jakarta-commons-sandbox/jelly/src/java/org/apache/commons/jelly/tags/core/FileTag.java
  
  Index: FileTag.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/jelly/src/java/org/apache/commons/jelly/tags/core/FileTag.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- FileTag.java	11 Dec 2002 12:40:54 -0000	1.6
  +++ FileTag.java	11 Jan 2003 10:47:59 -0000	1.7
  @@ -83,6 +83,9 @@
       private boolean prettyPrint;
       private String encoding;
       
  +    // should text be escaped - default to true for compatability
  +    private boolean escapeText = true;
  +
       public FileTag(){
       }
   
  @@ -159,6 +162,21 @@
           this.var = var;
       }
   
  +    /**
  +     * Returns whether the body of this tag will be escaped or not.
  +     */
  +    public boolean isEscapeText() {
  +        return escapeText;
  +    }
  +
  +    /**
  +     * Sets whether the body of the tag should be escaped as text (so that < and > are
  +     * escaped as < and >), which is the default or leave the text as XML.
  +     */
  +    public void setEscapeText(boolean escapeText) {
  +        this.escapeText = escapeText;
  +    }
  +
       // Implementation methods
       //------------------------------------------------------------------------- 
   
  @@ -201,6 +219,8 @@
           final XMLWriter xmlWriter = (isHtml) 
               ? new HTMLWriter(writer, format)
               : new XMLWriter(writer, format);
  +
  +        xmlWriter.setEscapeText(isEscapeText());
   
           XMLOutput answer = new XMLOutput() {
               public void close() throws IOException {
  
  
  

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>