This Example shows you how to Transform XML with SAXFilters. JAXP (Java API for XML Processing) is an interface which provides parsing of xml documents. Here the Document BuilderFactory is used to create new DOM parsers. There are some of the methods used in code given below for Transforming XML with SAXFilters:-
FileReader fileReader = new FileReader("Document2.xml"):-FileReader is a convenience class for reading character files. it is generally meant for reading streams of characters.
CustomFilter filter = new CustomFilter():-creates a custom filter.
XML code for the program generated is:-
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
XMLwithSAX.java
/*
|
Output of the program:-
<?xml version="1.0" encoding="UTF-8"?>
|
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: Transforming XML with SAXFilters
Post your Comment