473,326 Members | 2,114 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

xsd:maxLength

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

Nov 21 '05 #1
1 1500
I do not think such functionality if available.

"Sudhesh" <Su*****@mail.com> wrote in message
news:11**********************@g14g2000cwa.googlegr oups.com...
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

Nov 21 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Matthet | last post by:
Hi, Is there any difference if I write sth like this: <xsd:simpleType name="Name"> <xsd:restriction base="xsd:string"> <xsd:minLength value="1"> <xsd:maxLength value="10">...
2
by: Matthet | last post by:
Hi, I'm defining an element that is based on simpleType named "myPatternType" <xsd:element name="MyElement"> <xsd:complexType> <xsd:simpleContent> <xsd:extension base="myPatternType">...
1
by: Vitor Rodrigues | last post by:
Hi!! I have a little problem i'm trying to resolve. I've a .xml and it's schema (.xsd). i need to create a XSL file to transform the XML one, but i only now what data types the .xml file has by...
1
by: brendang | last post by:
Hi, I am getting the following errors on the schema (on the 'Fund_to' and 'Account_to' elements) in Visual Studio.NET when I try to validate the schema itself. I would greatly apreciate any help...
1
by: Sudhesh | last post by:
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>...
7
by: ray | last post by:
My xsd has the following element: <xs:element name="Company" minOccurs="0"> <xs:simpleType> <xs:restriction base="xs:string"> <xs:minLength value="1" /> <xs:maxLength value="5" />...
4
by: bibsoconner | last post by:
Hi, I hope someone can please help me. I'm having a lot of trouble with schema files in .NET. I have produced a very simple example that uses "include" to include other schema files. It all...
2
by: Per Skjondal | last post by:
Hi all. It might be a wild goose chase, but: I have a validation problem for a base-type in a xml shema definition. The type is : <xsd:simpleType name="Equipment_A_Base"> <xsd:restriction...
6
by: Thea | last post by:
Hi I am trying to use datatypes defined in xml file to check correctness of input parameter values To define needed datatypes following schema.xml file was created: <?xml version="1.0"?>...
6
by: RickH | last post by:
Hello, I would like to create a user XSD data type that inherits from the w3 standard data type called ID to make sure a certain repeated element always contains distinct values. The problem is...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.