How would I do ‘substring(variable,1,1) between a-z or A-Z’ then do X else do Y using XSLT? I know that one option would be using regex but I would expect there to be something that wasn’t quite so much overkill.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
A simple XSLT 1.0 solution:
This transformation:
when applied on any XML document (not used), produces the wanted result:
Depending on the specific case one can add whatever processing is necessary to each of the two ‘clauses’ (
<xsl:when>and<xsl:otherwise>) of the<xsl:choose>instruction.