This adds an API to the Validation Driver for directly working with SAX.
The issue I face without this is that within our XML Native Databases (i.e. eXist-db, Elemental, and FusionDB), XML documents are stored as a stream of SAX-like events.
When we wish to retrieve a document from the XML Native Database, we may do so using either SAX, StaX, or a lazy persistent like DOM approach.
However, all of the APIs for Jing's ValidationDriver require a SAX InputSource. Unfortunately a SAX InputSource requires you to take your XML data from either a Reader, InputStream, or URI (systemId)!
If we were to use an InputSource to take our data from the database, we would first have to first serialize our XML document from the database into a character stream stored on disk (or possibly in-memory), and then provide that to Jing. Jing would then have to deserialize that using an XMLReader to create a series of SAX events.
As our database can produce SAX events when reading a document, it is much more efficient to connect the two directly via SAX than it is to do a serialize and deserialize dance in the middle between the database and Jing.
I hope that makes sense, let me know if you have any questions - my changes are small and attempt to be as unobtrusive as possible! Kind regards :-)
This adds an API to the Validation Driver for directly working with SAX.
The issue I face without this is that within our XML Native Databases (i.e. eXist-db, Elemental, and FusionDB), XML documents are stored as a stream of SAX-like events.
When we wish to retrieve a document from the XML Native Database, we may do so using either SAX, StaX, or a lazy persistent like DOM approach.
However, all of the APIs for Jing's
ValidationDriver
require a SAXInputSource
. Unfortunately a SAXInputSource
requires you to take your XML data from either aReader
,InputStream
, or URI (systemId)!If we were to use an
InputSource
to take our data from the database, we would first have to first serialize our XML document from the database into a character stream stored on disk (or possibly in-memory), and then provide that to Jing. Jing would then have to deserialize that using anXMLReader
to create a series of SAX events.As our database can produce SAX events when reading a document, it is much more efficient to connect the two directly via SAX than it is to do a serialize and deserialize dance in the middle between the database and Jing.
I hope that makes sense, let me know if you have any questions - my changes are small and attempt to be as unobtrusive as possible! Kind regards :-)