471,123 Members | 978 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

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

setting minoccurs and maxoccurs with attributes

Does anyone know of a way to set minoccurs and maxoccurs from an attribute.
An example would be:

[WebMethod]
public string HelloWorld(DataInput dataInput)
{
return "Hello World";
}

public class DataInput
{
[XmlArrayItemAttribute("DataLineItem")]
public string[] DataLineItems = new string[10];
}

This results in:

<s:complexType name="DataInput">
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="DataLineItems"
type="tns:ArrayOfString" />
</s:sequence>
</s:complexType>
<s:complexType name="ArrayOfString">
<s:sequence>
<s:element minOccurs="0" maxOccurs="unbounded" name="DataLineItem"
nillable="true" type="s:string" />
</s:sequence>
</s:complexType>

What I would like is the maxoccurs for DataLineItem to be 10:

<s:complexType name="DataInput">
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="DataLineItems"
type="tns:ArrayOfString" />
</s:sequence>
</s:complexType>
<s:complexType name="ArrayOfString">
<s:sequence>
<s:element minOccurs="0" maxOccurs="10" name="DataLineItem"
nillable="true" type="s:string" />
</s:sequence>
</s:complexType>

Nov 23 '05 #1
0 920

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by joewhitehair | last post: by
reply views Thread by Jeremy Chapman | last post: by
reply views Thread by rt.64 | last post: by
6 posts views Thread by bruce_phipps | last post: by

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.