I'm writing a program and I have a problem. I want to read text between html tags. eg:
Some text .
Any idea how to do this?
You could use javax.xml.parsers.DocumentBuilder. From the API, [i]"An instance of this class can be obtained from the DocumentBuilderFactory.newDocumentBuilder()"[/i].
Then parse out a new DOM Document object - Document is an Interface.
Next I would get an Element type object, then a NodeList type object, in which you want to end up with a Node.
The Node type object contains several methods to extract or manipulate the text between tags. http://java.sun.com/javase/6/docs/api/org/w3c/dom/Node.html
Your use of this web site or any of its content or software indicates your agreement to be bound by these Terms of Participation.
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respective owners.