all groups > dotnet xml > september 2005 >
You're in the

dotnet xml

group:

xsd:maxLength


xsd:maxLength Sudhesh
9/29/2005 7:47:07 AM
dotnet xml:
Hi,

I understand I can write an XSD file like...

<xs:attribute name = "value1" use="required">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="30"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>

I'm writing a class heirarchy that I want to serialize into XML and I'd
like to incorporate the above mentioned restriction for maxlength in my
class. If I have a Pulic value1 as string, how do I restrict it to 30
characters? The only way I seem to have is to define it as a property
and trim it in the set property section.

My question is, is there a cleaner/nicer way, like the XML like
<XMLElementAttribute()> decoration that can achieve the same?

Thanks in advance
Sudhesh
Re: xsd:maxLength Zafar Abbas
9/30/2005 2:20:45 PM
I do not think such functionality if available.

[quoted text, click to view]

AddThis Social Bookmark Button