This Example describes a method to Normalize all of the Text in a DOM document. Methods which are used for Normalizing the text node in the DOM Document are described below :-
Element root = doc.getDocumentElement():-allows direct access to the root of the DOM document.
root.getNodeName():-gives the node name of the root.
root.normalize():-it normalize All of the Text in a Document
Xml code for the program generated is:-
| <?xml version="1.0"
encoding="UTF-8"?> <Company> <Location> <Companyname>Roseindia .Net</Companyname> <Employee>Girish Tewari</Employee> </Location> </Company> |
NormaliseText.java:
/* |
Output of the program:-
| Normalize root is: Company |
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.
Ask Questions? Discuss: Normalize All of the Text in a Document
Post your Comment