Skip to content

Conversation

@SingingBush
Copy link
Contributor

No description provided.

VersionInfoInvalid = Invalid version \"{0}\".
VersionNotSupported = XML version \"{0}\" is not supported, only XML 1.0 is supported.
VersionNotSupported11 = XML version \"{0}\" is not supported, only XML 1.0 and XML 1.1 are supported.
VersionNotSupported = XML version \"{0}\" is not supported, only XML 1.0 and XML 1.1 are supported.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I need to think about this. As I recall, it is possible to configure Xerces to only support XML 1.0 and not 1.1, and I've done that.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AFAIK the main branch doesn't support XSD 1.1.
In order to have Xerces-J support XSD 1.1 we have to use the xml-schema-1.1-dev branch and explicitly enable XSD 1.1 support with something like

import javax.xml.validation.SchemaFactory;

SchemaFactory factory = SchemaFactory.newInstance("http://www.w3.org/XML/XMLSchema/v1.1");
// Enable full XPath 2.0 for XSD 1.1 Conditional Type Assignment
// @see https://xerces.apache.org/xerces2-j/faq-xs.html#faq-3
factory.setFeature("http://apache.org/xml/features/validation/cta-full-xpath-checking", true);

schema = factory.newSchema(xsdLocation);

(see here for a sample usage)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants