I am completely new to the XSD . I have a requiremnt like that :
I have a element name Student of studenttype. It has an element name studentName and a attribute studentid(mandatory) (restrict values to 1- 1000)( make this ID).
I'm almost certain that the regex you produced doesn't actually match all numbers between 1 and 1000. Or even between 1 and 99999. I suspect it might match any string which consists of a digit followed by four 9's, but I'm no regex expert.
Joined: Mar 31, 2008
okey I think need to make my question more concise.. My query is suppose I have a attribute like studentId which must be unique and must be within the range 1 to 1000.
so for that my approach was
<restriction base="ID"> <!-- This will make the studentId unique-->
<pattern value="[1-1000]"></pattern> <!-- This will restrict the value within 1 to 1000-->
<attribute name="Studentid" use="required" type="studentIdType"></attribute>
whether this is correct way to write the requirement. Please assume the pattern is correct .
The problem I am facing that, If I generate any xml for this, Its not accepting the value for the attribute Studentid. I tried with 0 , 1 and some other random value.
its seems to me that its not accepting any number at all.
So please can anyone help me out why I am doing wrong.