use of org.loboevolution.html.dom.HTMLAllCollection in project LoboEvolution by LoboEvolution.
the class HTMLAllCollectionImpl method tags.
/**
* Returns all tags by name.
*
* @param tag the name of tag
* @return a {@link HTMLAllCollection} object.
*/
@Override
public HTMLAllCollection tags(String tag) {
final Document doc = this.rootNode.getOwnerDocument();
if (doc == null) {
return null;
}
final HTMLAllCollection list = (HTMLAllCollection) doc.getElementsByTagName(tag);
if (list.getLength() == 0) {
throw new DOMException(DOMException.NOT_FOUND_ERR, "is not a valid tag name.");
}
return list;
}
Aggregations