开发者

Error in ValidationExpression when using in XSLT

开发者 https://www.devze.com 2023-03-30 11:12 出处:网络
My XSLT shows that there is error in the below line, but i could not figure it out <asp:RegularExpressionValidator ID=\"validatorEmail{@id}\" runat=\"server\" Display=\"Dynamic\" ControlToValidate

My XSLT shows that there is error in the below line, but i could not figure it out

<asp:RegularExpressionValidator ID="validatorEmail{@id}" runat="server" Display="Dynamic" ControlToValidate="{@id}" Erro开发者_Python百科rMessage="username@domain.com" 

ValidationExpression="^(([\w-]+\.)+[\w-]+|([a-zA-Z]{1}|[\w-]{2,}))@((([0-1]?[0-9]{1,2}|25[0-5]|2[0-4][0-9])\.([0-1]?[0-9]{1,2}|25[0-5]|2[0-4][0-9])\.([0-1]?[0-9]{1,2}|25[0-5]|2[0-4][0-9])\.([0-1]?[0-9]{1,2}|25[0-5]|2[0-4][0-9])){1}|([a-zA-Z]+[\w-]+\.)+[a-zA-Z]{2,4})$" />

Error Message:

Expected token '}', found ','.  ...+\.)+[\w-]+|([a-zA-Z]{1}|[\w-]{2 -->,<-- }))@((([0-1]?[0-9]{1,2}|25[0-5]|... Forms.xslt

What is wrong with this?


In XSLT { and } are used to inject dynamic values in attribute value templates. You need to double them to escape them in your regular expression:

ValidationExpression="^(([\w-]+\.)+[\w-]+|([a-zA-Z]{{1}}|[\w-]{{2,}}))..."
0

精彩评论

暂无评论...
验证码 换一张
取 消