This Example shows you how to Create an InlineStream Filter. JAXP (Java API for XML Processing) is an interface which provides parsing of xml documents. There are some of the methods used in code given below for Creating a Filter:-
XMLInputFactory Factory = XMLInputFactory.newInstance():-By this method we create a new instance of the factory.
XMLStreamReader reader = Factory.createXMLStreamReader(new FileInputStream(file)):-Creates a new StreamReader which allows forward, read-only access to XML.
reader = factory.createFilteredReader(reader, new StreamFilter():-This method creates a filtered reader that wraps the filter around the reader.
Xml code for the program generated is:-
|
InlineStreamFilter.java
|
Output of the program:-
Line number = 1
|
DownLoad Source Code
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: Creating an InlineStreamFilter
Post your Comment