Can I check whether a particular pattern of character is there in the attribute
prathibha, ar
Greenhorn
Joined: Jun 22, 2001
Posts: 13
posted
0
Hi, I have got an xml file and an XSD. I am validating xml file writing all the rules in xsd. Suppose I want to check whether the character '@' is there in the email attribute of xml file. with regards prathibha
Aamir Memon
Greenhorn
Joined: Jul 05, 2001
Posts: 7
posted
0
hi, you can add something like the following restriction in your schema to make sure if it is a valid email address. <xsd:restriction base="xsd:string"> <xsd:maxLength value="128"/> <xsd:minLength value="5"/> <xsd pattern value="^[\w-_\.]*[\w-_\.]\@[\w-]+\.[\w-_\.]+$"/> </xsd:restriction> Aamir [This message has been edited by Aamir Memon (edited July 10, 2001).] [This message has been edited by Aamir Memon (edited July 10, 2001).] [This message has been edited by Aamir Memon (edited July 10, 2001).]
prathibha, ar
Greenhorn
Joined: Jun 22, 2001
Posts: 13
posted
0
Ho, thanyou very much. Can u please give me the details of this pattern <xsd attern value="^[\w-_\.]*[\w-_\.]\@[\w-]+\.[\w-_\.]+$"/> Like what is the correct value according to this pattern. If I want to replace this email format with a different number which contains numbers and an hyphen anywhere in the value, how should i write this thanks and regards prathibha
subject: Can I check whether a particular pattern of character is there in the attribute