Hi Mike,
    Answering this question (my personal opinions), while 2.12.3
release discussion is in progress in another thread :)

On Thu, May 5, 2022 at 2:09 AM Mike Beckerle <mbecke...@apache.org> wrote:
> I imagine that to validate XML, Xerces does something akin to "compiling" the 
> XSD into lower-level data structures for faster use when actually parsing 
> (and validating) the incoming XML being parsed.
>
> Question 1: Is that true?

Yes, Xerces compiles/translates XSD syntax to low-level data
structures. I think that, Xerces compiling the XSD syntax into
low-level data structures, is there to adhere to XSD defined component
models of various XSD syntax elements, more than for any performance
reasons.

> Question 2: Is it possible to get this "compilation" of the large XSD schema 
> done, and then serialize the resulting java object to a file, and reload this 
> pre-compiled thing so as not to face this compiling overhead at startup time?

I find this is a good idea.

Although currently not implemented, within Xerces, I think we could
have an api to serialize and deserialize org.apache.xerces.xs.XSModel,
or even javax.xml.validation.Schema to a file (using java's
java.io.Serializable mechanism). I think, currently
org.apache.xerces.xs.XSModel (and many of its dependencies) etc does
not implement the interface java.io.Serializable, which we need to do
so, if we need to implement this feature.

We also would need to make performance measurements, if in case, we'd
implement XSD schema serialization feature.

If possibly, you could create a jira issue (new feature) for this
requirement, that can make this requirement easy to track.


-- 
Regards,
Mukul Gandhi

---------------------------------------------------------------------
To unsubscribe, e-mail: j-users-unsubscr...@xerces.apache.org
For additional commands, e-mail: j-users-h...@xerces.apache.org

Reply via email to