[Htmlparser-user] Excluding some tags
Brought to you by:
derrickoswald
From: Manish K. <ma...@we...> - 2010-11-16 07:48:10
|
This indeed is a newbie question. I could not find a work around to exclude some tags (<script> in my case) while parsing. I tried using the NotFilter as underneath, but it didn't work as I got all the <script> tags in my NodeList - > NotFilter noScriptFilter = new NotFilter(); > noScriptFilter.setPredicate(new NodeFilter(){ > public boolean accept(Node currNode){ > if(currNode instanceof TagNode){ > if(((TagNode)currNode).getRawTagName().equalsIgnoreCase("script")){ > return true; > } > } > return false; > } > }); > NodeList allNodes = this.parser.parse(noScriptFilter); > Would appreciate if someone can guide me throgh this. Thanks Manish |