- 1
java program to read text_file(contains XML code but not formatted with tab) and output file generate with specifieng Tab
generate output file is text file.
3 Answers
0
What is the answer of this question
- 2
(note that--> without using any parser )Write a program to print INPUT XML on screen formatted as given in OUTPUT XML such that each level is indented by one tab e.g. first level is 1 tab, second level is 2 tabs indented and so on.
//input.txt
<?xml version="1.0" encoding="UTF-8"?>
<company>
<name> Tech PVT. Ltd.</name>
<employees>
<employee id="1">
<name>ABC PQR</name>
<address>
<line1>M G Road</line1>
<line2>nashik</line2>
<state>Maharashtra</state>
<city>Pune</city>
</address>
<phones>
<mobile>9876543210</mobile>
<landline>0209876543</landline>
</phones>
<education>
<degree>
<college>
<name>College of engineering</name>
<address>
<line1>M G Road</line1>
<line2>nagar</line2>
<state>Maharashtra</state>
<city>Pune</city>
</address>
</college>
</degree>
</education>
</employee>
</employees>
</company>
//Expected output
<?xml version="1.0" encoding="UTF-8"?>
<company>
<name>Raykor Technologies PVT ltd</name>
<employees>
<employee id="1">
<name>ABC PQR</name>
<address>
<line1> M G Road </line1>
<line2> Baner </line2>
<state> Maharashtra </state>
<city> Pune </city>
</address>
<phones>
<mobile> 9876543210 </mobile>
<landline> 0209876543 </landline>
</phones>
<education>
<degree>
<college>
<name>College of engineering<
name>
<address>
<line1> M G Road </line1>
<line2> Baner </line2>
<state> Maharashtra </state>
<city> Pune </city>
</address>
</college>
</degree>
</education>
</employee>
</employees>
</company>
- 7