[jsword-svn] common/java/core/org/crosswire/common/xml s

jswordcvs at crosswire.org jswordcvs at crosswire.org
Sun Feb 27 19:21:33 MST 2005


Update of /cvs/jsword/common/java/core/org/crosswire/common/xml
In directory www.crosswire.org:/tmp/cvs-serv26327/java/core/org/crosswire/common/xml

Modified Files:
	XMLUtil.java 
Log Message:
Fixed the display of the conf (BD-16, 17 & 18)

Index: XMLUtil.java
===================================================================
RCS file: /cvs/jsword/common/java/core/org/crosswire/common/xml/XMLUtil.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** XMLUtil.java	28 Nov 2004 21:36:31 -0000	1.7
--- XMLUtil.java	28 Feb 2005 02:21:30 -0000	1.8
***************
*** 88,91 ****
--- 88,129 ----
  
      /**
+      * Normalizes the given string
+      */
+      public static String escape(String s)
+      {
+          StringBuffer str = new StringBuffer(s.length());
+ 
+          int len = (s != null) ? s.length() : 0;
+          for (int i = 0; i < len; i++)
+          {
+              char ch = s.charAt(i); //$NON-NLS-1$
+              switch (ch)
+              {
+              case '<':
+                  str.append("&lt;"); //$NON-NLS-1$
+                  break;
+ 
+              case '>':
+                  str.append("&gt;"); //$NON-NLS-1$
+                  break;
+ 
+              case '&':
+                  str.append("&amp;"); //$NON-NLS-1$
+                  break;
+ 
+              case '"':
+                  str.append("&quot;"); //$NON-NLS-1$
+                  break;
+ 
+              default:
+                  str.append(ch);
+              }
+          }
+ 
+          return str.toString();
+      }
+ 
+ 
+     /**
       * A parse has failed so we can try to kill the broken entities and then have
       * another go.



More information about the jsword-svn mailing list