From n.e.x.g.e.n.s at gmail.com Tue Jun 21 16:15:07 2022 From: n.e.x.g.e.n.s at gmail.com (S R) Date: Wed Jun 22 09:54:56 2022 Subject: [xsde-users] XSDE unable to validate totalDigits restriction in xs:decimal element Message-ID: Hi I am trying to run a test with XSDE product xsde-3.2.0-x86_64-linux-gnu.tar.bz2 Our XSD has the following element which has triggered an issue with parsing. Our test case has this tag value as 6248245166124111525. This amount should fail parsing validation because of 19 total digits, where allowed is only 18 total digits. But there is no parsing exception thrown. The above value is successfully accepted. I tried to look for similar issues on the archives , but nothing I could not find for xsde. Thanks, S R From boris at codesynthesis.com Wed Jun 22 10:09:56 2022 From: boris at codesynthesis.com (Boris Kolpackov) Date: Wed Jun 22 10:05:28 2022 Subject: [xsde-users] XSDE unable to validate totalDigits restriction in xs:decimal element In-Reply-To: References: Message-ID: S R writes: > > > > > > > > > Our test case has this tag value as > 6248245166124111525. > > This amount should fail parsing validation because of 19 total digits, > where allowed is only 18 total digits. But there is no parsing exception > thrown. The above value is successfully accepted. XSD/e validates only the commonly-used subset of the XML Schema facets, as documented in these Appendices: https://codesynthesis.com/projects/xsde/documentation/cxx/parser/guide/#A https://codesynthesis.com/projects/xsde/documentation/cxx/serializer/guide/#A For decimal, these are min/maxExclusive and min/maxInclusive. You can, however, provide a custom parser and/or serializer implementation for your type that performs any additional validation, as described in "Customizing Parsers and Serializers": https://codesynthesis.com/projects/xsde/documentation/cxx/hybrid/guide/#6.1 From n.e.x.g.e.n.s at gmail.com Thu Jun 23 08:09:56 2022 From: n.e.x.g.e.n.s at gmail.com (S R) Date: Thu Jun 23 08:05:46 2022 Subject: [xsde-users] XSDE unable to validate totalDigits restriction in xs:decimal element In-Reply-To: References: Message-ID: Thanks Boris. Is there a simple way to plug in a regular expression and enforce the totalDigits/fractionDigits facets rather than having a complete new class for custom parsing and serialization? On Wed, Jun 22, 2022 at 10:10 AM Boris Kolpackov wrote: > S R writes: > > > > > > > > > > > > > > > > > > > Our test case has this tag value as > > 6248245166124111525. > > > > This amount should fail parsing validation because of 19 total digits, > > where allowed is only 18 total digits. But there is no parsing exception > > thrown. The above value is successfully accepted. > > XSD/e validates only the commonly-used subset of the XML Schema facets, > as documented in these Appendices: > > https://codesynthesis.com/projects/xsde/documentation/cxx/parser/guide/#A > > > https://codesynthesis.com/projects/xsde/documentation/cxx/serializer/guide/#A > > For decimal, these are min/maxExclusive and min/maxInclusive. > > You can, however, provide a custom parser and/or serializer implementation > for your type that performs any additional validation, as described in > "Customizing Parsers and Serializers": > > https://codesynthesis.com/projects/xsde/documentation/cxx/hybrid/guide/#6.1 > From boris at codesynthesis.com Tue Jun 28 09:22:20 2022 From: boris at codesynthesis.com (Boris Kolpackov) Date: Tue Jun 28 09:17:48 2022 Subject: [xsde-users] XSDE unable to validate totalDigits restriction in xs:decimal element In-Reply-To: References: Message-ID: S R writes: > Is there a simple way to plug in a regular expression and enforce the > totalDigits/fractionDigits facets rather than having a complete new class > for custom parsing and serialization? As can be gleaned from the links in my earlier reply, XSD/e supports the pattern facet (only valid for string-based types) so provided you built the XSD/e runtime with regex support, you could try to come up with a suitable pattern. From n.e.x.g.e.n.s at gmail.com Wed Jun 29 08:23:32 2022 From: n.e.x.g.e.n.s at gmail.com (S R) Date: Wed Jun 29 08:19:22 2022 Subject: [xsde-users] XSDE unable to validate totalDigits restriction in xs:decimal element In-Reply-To: References: Message-ID: Understood. Thanks Boris. On Tue, Jun 28, 2022 at 9:22 AM Boris Kolpackov wrote: > S R writes: > > > Is there a simple way to plug in a regular expression and enforce the > > totalDigits/fractionDigits facets rather than having a complete new class > > for custom parsing and serialization? > > As can be gleaned from the links in my earlier reply, XSD/e supports > the pattern facet (only valid for string-based types) so provided > you built the XSD/e runtime with regex support, you could try to > come up with a suitable pattern. >