private void loadBookmarks(Document doc) { Element head = DOMUtil.getChild(doc.getDocumentElement(), "head"); if (head != null) { Element bookmarks = DOMUtil.getChild(head, "bookmarks"); if (bookmarks != null) { List l = DOMUtil.getChildren(bookmarks, "bookmark"); if (l != null) { for (Iterator i = l.iterator(); i.hasNext();) { Element e = (Element) i.next(); loadBookmark(null, e); } } } } }
/** * Loads all of the text content in all offspring of an element. * Ignores all attributes, comments and processing instructions. * * @return a String with the text content of an element (may be an empty string but will not be null). */ public static String getText(Element parent) { StringBuilder sb = new StringBuilder(); getText(parent, sb); return sb.toString(); }
Element head = DOMUtil.getChild(doc.getDocumentElement(), "head"); if (head != null) { List l = DOMUtil.getChildren(head, "meta"); if (l != null) { for (Iterator i = l.iterator(); i.hasNext();) { Element t = DOMUtil.getChild(head, "title"); if (t != null) { title = DOMUtil.getText(t).trim(); Metadata m = new Metadata("title", title); _metadata.add(m);
private void loadBookmark(Bookmark parent, Element bookmark) { Bookmark us = new Bookmark(bookmark.getAttribute("name"), bookmark.getAttribute("href")); if (parent == null) { _bookmarks.add(us); } else { parent.addChild(us); } List l = DOMUtil.getChildren(bookmark, "bookmark"); if (l != null) { for (Iterator i = l.iterator(); i.hasNext();) { Element e = (Element) i.next(); loadBookmark(us, e); } } }
Element head = DOMUtil.getChild(doc.getDocumentElement(), "head"); if (head != null) { List l = DOMUtil.getChildren(head, "meta"); if (l != null) { for (Iterator i = l.iterator(); i.hasNext();) { Element t = DOMUtil.getChild(head, "title"); if (t != null) { title = DOMUtil.getText(t).trim(); Metadata m = new Metadata("title", title); _metadata.add(m);
private void loadBookmark(Bookmark parent, Element bookmark) { Bookmark us = new Bookmark(bookmark.getAttribute("name"), bookmark.getAttribute("href")); if (parent == null) { _bookmarks.add(us); } else { parent.addChild(us); } List l = DOMUtil.getChildren(bookmark, "bookmark"); if (l != null) { for (Iterator i = l.iterator(); i.hasNext();) { Element e = (Element) i.next(); loadBookmark(us, e); } } }
Element head = DOMUtil.getChild(doc.getDocumentElement(), "head"); if (head != null) { List l = DOMUtil.getChildren(head, "meta"); if (l != null) { for (Iterator i = l.iterator(); i.hasNext();) { Element t = DOMUtil.getChild(head, "title"); if (t != null) { title = DOMUtil.getText(t).trim(); Metadata m = new Metadata("title", title); _metadata.add(m);
private void loadBookmarks(Document doc) { Element head = DOMUtil.getChild(doc.getDocumentElement(), "head"); if (head != null) { Element bookmarks = DOMUtil.getChild(head, "bookmarks"); if (bookmarks != null) { List l = DOMUtil.getChildren(bookmarks, "bookmark"); if (l != null) { for (Iterator i = l.iterator(); i.hasNext();) { Element e = (Element) i.next(); loadBookmark(null, e); } } } } }
private void loadBookmark(Bookmark parent, Element bookmark) { Bookmark us = new Bookmark(bookmark.getAttribute("name"), bookmark.getAttribute("href")); if (parent == null) { _bookmarks.add(us); } else { parent.addChild(us); } List l = DOMUtil.getChildren(bookmark, "bookmark"); if (l != null) { for (Iterator i = l.iterator(); i.hasNext();) { Element e = (Element) i.next(); loadBookmark(us, e); } } }
/** * Loads all of the text content in all offspring of an element. * Ignores all attributes, comments and processing instructions. * * @return a String with the text content of an element (may be an empty string but will not be null). */ public static String getText(Element parent) { StringBuilder sb = new StringBuilder(); getText(parent, sb); return sb.toString(); }
private void loadBookmarks(Document doc) { Element head = DOMUtil.getChild(doc.getDocumentElement(), "head"); if (head != null) { Element bookmarks = DOMUtil.getChild(head, "bookmarks"); if (bookmarks != null) { List l = DOMUtil.getChildren(bookmarks, "bookmark"); if (l != null) { for (Iterator i = l.iterator(); i.hasNext(); ) { Element e = (Element)i.next(); loadBookmark(null, e); } } } } }
private void loadBookmark(Bookmark parent, Element bookmark) { Bookmark us = new Bookmark(bookmark.getAttribute("name"), bookmark.getAttribute("href")); if (parent == null) { _bookmarks.add(us); } else { parent.addChild(us); } List l = DOMUtil.getChildren(bookmark, "bookmark"); if (l != null) { for (Iterator i = l.iterator(); i.hasNext(); ) { Element e = (Element)i.next(); loadBookmark(us, e); } } }
/** * Loads all of the text content in all offspring of an element. * Ignores all attributes, comments and processing instructions. * * @return a String with the text content of an element (may be an empty string but will not be null). */ public static String getText(Element parent) { StringBuilder sb = new StringBuilder(); getText(parent, sb); return sb.toString(); }
private void loadBookmarks(Document doc) { Element head = DOMUtil.getChild(doc.getDocumentElement(), "head"); if (head != null) { Element bookmarks = DOMUtil.getChild(head, "bookmarks"); if (bookmarks != null) { List l = DOMUtil.getChildren(bookmarks, "bookmark"); if (l != null) { for (Iterator i = l.iterator(); i.hasNext();) { Element e = (Element) i.next(); loadBookmark(null, e); } } } } }
private void loadBookmark(Bookmark parent, Element bookmark) { Bookmark us = new Bookmark(bookmark.getAttribute("name"), bookmark.getAttribute("href")); if (parent == null) { _bookmarks.add(us); } else { parent.addChild(us); } List l = DOMUtil.getChildren(bookmark, "bookmark"); if (l != null) { for (Iterator i = l.iterator(); i.hasNext(); ) { Element e = (Element)i.next(); loadBookmark(us, e); } } }
/** * Appends all text content in all offspring of an element to a StringBuffer. * Ignores all attributes, comments and processing instructions. * * @return a String with the text content of an element (may be an empty string but will not be null). */ public static void getText(Element parent, StringBuilder sb) { NodeList children = parent.getChildNodes(); for (int i = 0; i < children.getLength(); i++) { Node n = (Node)children.item(i); if (n.getNodeType() == Node.ELEMENT_NODE) { getText((Element)n, sb); } else if (n.getNodeType() == Node.TEXT_NODE) { sb.append(n.getNodeValue()); } } } }
private void loadBookmarks(Document doc) { Element head = DOMUtil.getChild(doc.getDocumentElement(), "head"); if (head != null) { Element bookmarks = DOMUtil.getChild(head, "bookmarks"); if (bookmarks != null) { List l = DOMUtil.getChildren(bookmarks, "bookmark"); if (l != null) { for (Iterator i = l.iterator(); i.hasNext(); ) { Element e = (Element)i.next(); loadBookmark(null, e); } } } } }
/** * Appends all text content in all offspring of an element to a StringBuffer. * Ignores all attributes, comments and processing instructions. * * @return a String with the text content of an element (may be an empty string but will not be null). */ public static void getText(Element parent, StringBuilder sb) { NodeList children = parent.getChildNodes(); for (int i = 0; i < children.getLength(); i++) { Node n = (Node)children.item(i); if (n.getNodeType() == Node.ELEMENT_NODE) { getText((Element)n, sb); } else if (n.getNodeType() == Node.TEXT_NODE) { sb.append(n.getNodeValue()); } } } }
/** * Appends all text content in all offspring of an element to a StringBuffer. * Ignores all attributes, comments and processing instructions. * * @return a String with the text content of an element (may be an empty string but will not be null). */ public static void getText(Element parent, StringBuilder sb) { NodeList children = parent.getChildNodes(); for (int i = 0; i < children.getLength(); i++) { Node n = (Node)children.item(i); if (n.getNodeType() == Node.ELEMENT_NODE) { getText((Element)n, sb); } else if (n.getNodeType() == Node.TEXT_NODE) { sb.append(n.getNodeValue()); } } } }