Author: wglass
Date: Mon Jan 31 17:00:56 2005
New Revision: 149337

URL: http://svn.apache.org/viewcvs?view=rev&rev=149337
Log:
set line endings to be consistent and based on platform.  
http://issues.apache.org/bugzilla/show_bug.cgi?id=33296

Added:
    jakarta/velocity/trunk/build/lib/jdom-1.0.jar   (with props)
Removed:
    jakarta/velocity/trunk/build/lib/jdom-b10-rc1.jar
Modified:
    jakarta/velocity/trunk/project.xml
    
jakarta/velocity/trunk/src/java/org/apache/velocity/anakia/AnakiaElement.java
    jakarta/velocity/trunk/src/java/org/apache/velocity/anakia/Escape.java

Added: jakarta/velocity/trunk/build/lib/jdom-1.0.jar
URL: 
http://svn.apache.org/viewcvs/jakarta/velocity/trunk/build/lib/jdom-1.0.jar?view=auto&rev=149337
==============================================================================
Binary file - no diff available.

Propchange: jakarta/velocity/trunk/build/lib/jdom-1.0.jar
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Modified: jakarta/velocity/trunk/project.xml
URL: 
http://svn.apache.org/viewcvs/jakarta/velocity/trunk/project.xml?view=diff&r1=149336&r2=149337
==============================================================================
--- jakarta/velocity/trunk/project.xml (original)
+++ jakarta/velocity/trunk/project.xml Mon Jan 31 17:00:56 2005
@@ -146,7 +146,7 @@
 
     <dependency>
       <id>jdom</id>
-      <version>b10</version>
+      <version>1.0</version>
     </dependency>
 
     <dependency>

Modified: 
jakarta/velocity/trunk/src/java/org/apache/velocity/anakia/AnakiaElement.java
URL: 
http://svn.apache.org/viewcvs/jakarta/velocity/trunk/src/java/org/apache/velocity/anakia/AnakiaElement.java?view=diff&r1=149336&r2=149337
==============================================================================
--- 
jakarta/velocity/trunk/src/java/org/apache/velocity/anakia/AnakiaElement.java 
(original)
+++ 
jakarta/velocity/trunk/src/java/org/apache/velocity/anakia/AnakiaElement.java 
Mon Jan 31 17:00:56 2005
@@ -28,18 +28,22 @@
  * same way as a single-element [EMAIL PROTECTED] NodeList} would.
  *
  * @author <a href="mailto:[EMAIL PROTECTED]">Attila Szegedi</a>
- * @version $Id: AnakiaElement.java,v 1.5 2004/03/19 17:13:32 dlr Exp $
+ * @version $Id$
  */
 public class AnakiaElement extends Element
 {
     private static final XMLOutputter DEFAULT_OUTPUTTER = new XMLOutputter();
 
+    static {
+        
DEFAULT_OUTPUTTER.getFormat().setLineSeparator(System.getProperty("line.separator"));
+    }
+
     /**
      * <p>
      * This will create a new <code>AnakiaElement</code>
      *   with the supplied (local) name, and define
      *   the <code>[EMAIL PROTECTED] Namespace}</code> to be used.
-     * If the provided namespace is null, the element will have 
+     * If the provided namespace is null, the element will have
      * no namespace.
      * </p>
      *
@@ -98,7 +102,7 @@
     {
         super(name, prefix, uri);
     }
-    
+
     /**
      * Applies an XPath expression to this element and returns the resulting
      * node list. In order for this method to work, your application must have
@@ -126,15 +130,15 @@
     {
         return DEFAULT_OUTPUTTER.outputString(this);
     }
-    
+
     /**
      * <p>
      * This returns the full content of the element as a NodeList which
      * may contain objects of type <code>String</code>, <code>Element</code>,
      * <code>Comment</code>, <code>ProcessingInstruction</code>,
-     * <code>CDATA</code>, and <code>EntityRef</code>.  
-     * The List returned is "live" in document order and modifications 
-     * to it affect the element's actual contents.  Whitespace content is 
+     * <code>CDATA</code>, and <code>EntityRef</code>.
+     * The List returned is "live" in document order and modifications
+     * to it affect the element's actual contents.  Whitespace content is
      * returned in its entirety.
      * </p>
      *
@@ -149,14 +153,14 @@
     {
         return new NodeList(super.getContent(), false);
     }
-    
+
     /**
      * <p>
      * This returns a <code>NodeList</code> of all the child elements
-     * nested directly (one level deep) within this element, as 
-     * <code>Element</code> objects.  If this target element has no nested 
+     * nested directly (one level deep) within this element, as
+     * <code>Element</code> objects.  If this target element has no nested
      * elements, an empty List is returned.  The returned list is "live"
-     * in document order and changes to it affect the element's actual 
+     * in document order and changes to it affect the element's actual
      * contents.
      * </p>
      * <p>
@@ -185,9 +189,9 @@
      * <p>
      * This returns a <code>NodeList</code> of all the child elements
      * nested directly (one level deep) within this element with the given
-     * local name and belonging to no namespace, returned as 
-     * <code>Element</code> objects.  If this target element has no nested 
-     * elements with the given name outside a namespace, an empty List 
+     * local name and belonging to no namespace, returned as
+     * <code>Element</code> objects.  If this target element has no nested
+     * elements with the given name outside a namespace, an empty List
      * is returned.  The returned list is "live" in document order
      * and changes to it affect the element's actual contents.
      * </p>
@@ -208,9 +212,9 @@
      * <p>
      * This returns a <code>NodeList</code> of all the child elements
      * nested directly (one level deep) within this element with the given
-     * local name and belonging to the given Namespace, returned as 
-     * <code>Element</code> objects.  If this target element has no nested 
-     * elements with the given name in the given Namespace, an empty List 
+     * local name and belonging to the given Namespace, returned as
+     * <code>Element</code> objects.  If this target element has no nested
+     * elements with the given name in the given Namespace, an empty List
      * is returned.  The returned list is "live" in document order
      * and changes to it affect the element's actual contents.
      * </p>
@@ -230,10 +234,10 @@
 
     /**
      * <p>
-     * This returns the complete set of attributes for this element, as a 
-     * <code>NodeList</code> of <code>Attribute</code> objects in no 
particular 
-     * order, or an empty list if there are none.  
-     * The returned list is "live" and changes to it affect the 
+     * This returns the complete set of attributes for this element, as a
+     * <code>NodeList</code> of <code>Attribute</code> objects in no particular
+     * order, or an empty list if there are none.
+     * The returned list is "live" and changes to it affect the
      * element's actual attributes.
      * </p>
      *

Modified: jakarta/velocity/trunk/src/java/org/apache/velocity/anakia/Escape.java
URL: 
http://svn.apache.org/viewcvs/jakarta/velocity/trunk/src/java/org/apache/velocity/anakia/Escape.java?view=diff&r1=149336&r2=149337
==============================================================================
--- jakarta/velocity/trunk/src/java/org/apache/velocity/anakia/Escape.java 
(original)
+++ jakarta/velocity/trunk/src/java/org/apache/velocity/anakia/Escape.java Mon 
Jan 31 17:00:56 2005
@@ -18,14 +18,18 @@
 
 /**
  * This class is for escaping CDATA sections. The code was 
- * "borrowed" from the JDOM code. I also added in escaping
- * of the " -> &amp;quot; character.
+ * "borrowed" from the JDOM code. Also included is escaping
+ * the " -> &amp;quot; character and the conversion of newlines
+ * to the platform line separator.
  *
+ * @author <a href="mailto:[EMAIL PROTECTED]">Will Glass-Husain</a>
  * @author <a href="mailto:[EMAIL PROTECTED]">Jon S. Stevens</a>
- * @version $Id: Escape.java,v 1.6 2004/03/19 17:13:32 dlr Exp $
+ * @version $Id$
  */
 public class Escape
 {
+    public static String LINE_SEPARATOR = System.getProperty("line.separator");
+    
     /**
      * Empty constructor
      */
@@ -59,6 +63,9 @@
                     break;
                 case '"' :
                     stEntity = "&quot;";
+                    break;
+                case '\n' :
+                    stEntity = LINE_SEPARATOR;
                     break;
                 default :
                     /* no-op */ ;



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

Reply via email to