This is Interesting: Free Magazines for Graphics designers and webmasters  


Home > Archive > Microsoft XML > August 2005 > howto define max length of a simple (string) type in .xsd





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author howto define max length of a simple (string) type in .xsd
Jan

2005-08-24, 7:24 am

Hi,

I am sure it is an easy question for most of you...

I've got the following element:

<xs:element name="LastName" type="xs:string">

How can I define the max length allawd for this field..?

cheers,
jan
Lee Alexander

2005-08-24, 8:04 pm

Here you go:
<xs:element name="LastName">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxlength value="8"/>
</xs:restriction>
</xs:simpleType>
</xs:element>

Here i've set the max length to 8.

Regards
Lee

"Jan" <Jan@discussions.microsoft.com> wrote in message
news:02CD2934-2552-4FEE-AFF6-F50D8FAAFE08@microsoft.com...
> Hi,
>
> I am sure it is an easy question for most of you...
>
> I've got the following element:
>
> <xs:element name="LastName" type="xs:string">
>
> How can I define the max length allawd for this field..?
>
> cheers,
> jan



Sponsored Links


Copyright 2003 - 2008 forum4designers.com  Software forum  Computer Hardware reviews