-
-
Notifications
You must be signed in to change notification settings - Fork 80
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
XSD 1.1 support? #92
Comments
Woodstox has MSV-based validator implementation, and MSV has not been developed for years. If you or someone else finds alternate validator that can work on incremental/streaming input, it is possible to implement alternative validator implementation: code within parser is not MSV-specific, just requires certain callbacks to be implemented. |
It should be possible to run the Woodstox XML parser with the Saxon schema validator, simply by invoking Saxon's SchemaValidator API (see https://www.saxonica.com/documentation/index.html#!javadoc/net.sf.saxon.s9api/SchemaValidator) using Saxon's schema validator runs in push mode, so it can't be run in tandem with Woodstox within a pull pipeline, but the pull-push combination is still fully streamed. You could also construct a pull pipeline that "tees" events off into the validator, if you don't want anything from the validator other than notification of invalidities. |
@michaelhkay unless I misunderstand what you mean by Saxon's schema validator running in push mode, this seems compatible with the way Woodstox works both for Stax (pull) and SAX modes (push) -- Woodstox will call state update methods on validator like you describe (and not just with parser but also, optionally, generator). If so, all (?) that would be needed would be an additional Woodstox component to call proper methods in Saxon validator instead of MSV validators. Such a component probably should live in an artifact of its own, depending on |
Yes, I always think of Woodstox as a pull parser because that's how I use it, but now you mention it, you can do the pull-push loop either in Woodstox or in Saxon, either should work perfectly well. What you can't do is to put the Saxon validator onto a pull pipeline. |
@michaelhkay yes, right, makes sense. For practical reasons (to be able to use MSV validators), validation approach is pull/push combination with a simple interface to allow plugging in different backends (although that possibility has been mostly theoretical so far). There may of course be some differences between what MSV expects and what Saxon's validator expects, but conceptually it should match I think. |
I'm trying to use woodstox with a schema that is conformant to the XSD v1.1 specification (specifically that it contains conditional type alternatives using xPath 2.0 assertions) and it would seem that MSV doesn't support this unless there are any construction options that I am unaware of, as I repeatedly get the error
element "xs:alternative" is not allowed here
upon an attempt to construct theXMLSchemaGrammar
viaXMLSchemaReader::parse
using aSAXParserFactory
fromcom.ctc.wstx.msv.BaseSchemaFactory::getSaxFactory
.Does woodstox support XSD v1.1 validation? If not, does woodstox support alternative validators other than MSV?
I tried using
xerces-2.12.0
to parse the XSD and construct the validator to inject into woodstox as it does support conditional type assignment, but had issues with resolving it in the classpath via the standard mechanism:As specified here: https://xerces.apache.org/xerces2-j/faq-xs.html#faq-1
The text was updated successfully, but these errors were encountered: