Simple example of using Xerces XNI?

Is there a simple example of using Xerces XNI ? I am going through the sample code and cannot do the heads or tails of what it does and I don’t want to just cut and paste into my application. For example, I cannot figure out how to create an instance org.apache.xerces.xni.parser.XMLDocumentSource



source to share

1 answer

org.apache.xerces.xni.parser.XMLDocumentSource is an interface, so the simple answer is that you create a class that implements that interface. Unless you really want to hack Xerces for some reason, you probably don't need to worry about XNI.

What do you want to do?

An XML programmer does not need to learn XNI if they only intend to interact with the Xerces2 parser using standard interfaces such as JAXP, DOM and SAX ( )

You can get more miles from looking at javax.xml.parsers at



All Articles