Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

error validating phone number with pattern

Status
Not open for further replies.

jrenae

Programmer
Jan 18, 2006
142
US
I don't understand why I'm getting the error when validating against a a schema file in Visual Studio.

My phone number value is 10 digits with no alpha, yet the intellisense tells me the phone number cannot contain text.

Any ideas?

Thanks in advance.

phone number value = 9999999999
xml
Code:
<PhoneNumber PhoneNumberType="Work">9999999999</PhoneNumber>

schema
Code:
	<xs:simpleType name="PhoneNumberValue">
		<xs:restriction base="xs:string">
			<xs:maxLength value="14"/>
			<xs:pattern value="\d{10,14}"/>
		</xs:restriction>
	</xs:simpleType>
 
never mind...I didn't have my xml nodes defined according to the schema. I was missing the node 'PhoneNumberValue'.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top