Last active
December 21, 2015 07:19
-
-
Save kelvinewilliams/6270514 to your computer and use it in GitHub Desktop.
Java: DOM Check a Document (org.w3c.dom.Document) for the presence of a tag.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private boolean hasTag(Document document, String tag) { | |
NodeList nodeList = document.getElementsByTagName(tag); | |
return (nodeList.getLength() > 0); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment