Skip to content
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

False negative XML validation #24

Open
FeyFre opened this issue Nov 27, 2019 · 0 comments
Open

False negative XML validation #24

FeyFre opened this issue Nov 27, 2019 · 0 comments

Comments

@FeyFre
Copy link

FeyFre commented Nov 27, 2019

Consider next declaration of element type in schema file:

	<xsd:simpleType name="legacyDateType">
		<xsd:union memberTypes="isoDateType europeDateType"/>
	</xsd:simpleType>
	<xsd:simpleType name="europeDateType">
		<xsd:annotation>
			<xsd:documentation>Format dd.MM.yyyy or dd/MM/yyyy</xsd:documentation>
		</xsd:annotation>
		<xsd:restriction base="xsd:string">
			<xsd:whiteSpace value="collapse"/>
			<xsd:pattern value="(0{0,1}[1-9]|[12][0-9]|3[01])[/.](0{0,1}[1-9]|1[012])[/.](18|19|20)[0-9]{2}"/>
		</xsd:restriction>
	</xsd:simpleType>
	<xsd:simpleType name="isoDateType">
		<xsd:annotation>
			<xsd:documentation>Format yyyy-MM-dd</xsd:documentation>
		</xsd:annotation>
		<xsd:restriction base="xsd:date">
			<xsd:minInclusive value="1800-01-01"/>
			<xsd:maxInclusive value="2100-01-01"/>
		</xsd:restriction>
	</xsd:simpleType>

So element with some date is supposed to validate both '2019-11-11' and '11.11.2019', however it always complains about second form, as if second member of xsd:union is ignored.
Probably it is due to update xml backend? I've used xerces to check it - validates as expected

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

No branches or pull requests

1 participant