| 624 | |
| 625 | // borrowed from lai-xin-chu: http://stackoverflow.com/questions/12576119 |
| 626 | private String getText(Node node) { |
| 627 | NodeList children = node.getChildNodes(); |
| 628 | StringBuffer sb = new StringBuffer(); |
| 629 | for (int i = 0; i < children.getLength(); i++) { |
| 630 | Node child = children.item(i); |
| 631 | switch (child.getNodeType()) { |
| 632 | case Node.ELEMENT_NODE: |
| 633 | sb.append(getText(child)); |
| 634 | sb.append(" "); |
| 635 | break; |
| 636 | case Node.TEXT_NODE: |
| 637 | sb.append(((Text) child).getData()); |
| 638 | break; |
| 639 | } |
| 640 | } |
| 641 | return sb.toString(); |
| 642 | } |
| 643 | |
| 644 | /** |
| 645 | * Delete an existing entry for the specified feed. |