(String source, String needle)
| 165 | } |
| 166 | |
| 167 | private String findBlock(String source, String needle) { |
| 168 | String startItem = "<" + needle + ">"; |
| 169 | int start = source.indexOf(startItem); |
| 170 | int end = source.indexOf("</" + needle + ">"); |
| 171 | |
| 172 | if (start > -1 && end > -1 && start != end) { |
| 173 | return source.substring(start + startItem.length(), end); |
| 174 | } |
| 175 | |
| 176 | return ""; |
| 177 | } |
| 178 | |
| 179 | private String createBlock(String needle, String value) { |
| 180 | StringBuffer block = new StringBuffer("<").append(needle).append('>'); |