473,383 Members | 1,868 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,383 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 12 '05 #1
1 3209
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 12 '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: 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...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.