Schematron validation for string value
Posted: Fri May 17, 2019 5:28 am
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?