View Javadoc
1   package org.kuali.ole.docstore.utility;
2   
3   import java.util.regex.Matcher;
4   import java.util.regex.Pattern;
5   
6   /**
7    * Created by IntelliJ IDEA.
8    * User: Sreekanth
9    * Date: 6/4/12
10   * Time: 4:20 PM
11   * To change this template use File | Settings | File Templates.
12   */
13  public class XMLUtility {
14      public static final String FIELD_SEPERATOR = ",";
15  
16      public StringBuffer getAllContentText(String content) {
17          String reg = "<.*>(.*)<\\/.*?>";
18          Pattern p = Pattern.compile(reg);
19          StringBuffer buffer = new StringBuffer();
20          if (content.length() > 0) {
21              Matcher m = p.matcher(content);
22              while (m.find()) {
23                  String allText = m.group(1);
24                  buffer.append(allText + FIELD_SEPERATOR);
25              }
26          }
27          return buffer;
28  
29      }
30  
31  
32  }