Schematron validation for string value
Having trouble deploying Oxygen XML Web Author? Got a bug to report? Post it all here.
-
- Posts: 1
- Joined: Fri May 17, 2019 5:22 am
Schematron validation for string value
I'm trying to validation a 6 digit number
Example:
1.) 120012
need to validate the above number in Schematron but when I use substring(.,2,5) != "00" it is not validating.
2.) 21
Making the above number to 6 digits value and validating with the above rule doesn't work
3.) similarly I need to validate the above number 000021 not to have 00 in 1st and 2nd position, 00 in 3rd and 4th position, 00 in 5th and 6th position
210021 - the number is bad should throw validation
102101 - the number is good
XML has 21 but appending 000021 in Java and passing it to Schematron
Could you please help?
Example:
1.) 120012
need to validate the above number in Schematron but when I use substring(.,2,5) != "00" it is not validating.
2.) 21
Making the above number to 6 digits value and validating with the above rule doesn't work
3.) similarly I need to validate the above number 000021 not to have 00 in 1st and 2nd position, 00 in 3rd and 4th position, 00 in 5th and 6th position
210021 - the number is bad should throw validation
102101 - the number is good
XML has 21 but appending 000021 in Java and passing it to Schematron
Could you please help?
-
- Posts: 388
- Joined: Thu Jul 01, 2004 12:29 pm
Re: Schematron validation for string value
Hello,
This is a Schematron issue, therefore I recommend you to use the schematron@schematronist.org user list to get a better response. For this you need to register on the user list "http://schematronist.org/mailman/listin ... ronist.org".
In my opinion you can add 3 checks something like this:
But there are also other solutions, maybe using the "matches()" function and a regular expression.
Best Regards,
Octavian
This is a Schematron issue, therefore I recommend you to use the schematron@schematronist.org user list to get a better response. For this you need to register on the user list "http://schematronist.org/mailman/listin ... ronist.org".
In my opinion you can add 3 checks something like this:
- if the '00' is on the first and second position: "substring(.,1,2) != '00'"
- if the '00' is on the third and fourth position: "substring(.,3,2) != '00'"
- if the '00' is on the fifth and sixth position: "substring(.,5,2) != '00'"
But there are also other solutions, maybe using the "matches()" function and a regular expression.
Best Regards,
Octavian
Octavian Nadolu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service