HighTechTalks DotNet Forums  

PROBLEM WITH MAXOCCURS ATTRIBUTE

Dotnet XML microsoft.public.dotnet.xml


Discuss PROBLEM WITH MAXOCCURS ATTRIBUTE in the Dotnet XML forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
Ganesh Muthuvelu
 
Posts: n/a

Default PROBLEM WITH MAXOCCURS ATTRIBUTE - 06-20-2006 , 05:17 PM






Hello,
Please see the following schema:

**********************
<?xml version="1.0" encoding="ISO-8859-1"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified">
<xs:element name="persons">
<xs:complexType>
<xs:sequence>
<xs:element name="person" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="full_name" type="xs:string"/>
<xs:element name="child_name" type="UserService"
minOccurs="0" maxOccurs="5"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>

<xs:simpleType name="UserService">
<xs:restriction base="xs:string">
<xs:enumeration value="Alternate Numbers" />
<xs:enumeration value="Anonymous Call Rejection" />
<xs:enumeration value="Attendant Console" />
</xs:restriction>
</xs:simpleType>

</xs:schema>
**********************

If I load this schema to a dataset and then load the following XML data, my
child elements C2 and C3 do not show up in the XML string that I retrieve
back from the dataset.. Can someone help?

**************
<?xml version="1.0" encoding="ISO-8859-1"?>
<persons>
<person>
<full_name>Ganesh Muthuvelu</full_name>
<child_name>C1</child_name>
<child_name>C2</child_name>
<child_name>C3</child_name>
</person>
</persons>
**************


Thanks,
Ganesh

Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.