XML Schema

V

VJK

Hello,


My XML file is as follows:


---------edited section begins-------------
<name>
<firstName>value1</firstName>
<\name>


<name>
<firstName>value1</firstName>
<middleName>value2</middleName­>
<\name>


<name>
<firstName>value1</firstName>
<middleName>value2</middleName­>
<lastName>value3</lastName>
<\name>


---------edited section ends-------------


Could someone emplain, how to write a valid XML schema for this, please
?


Thanks,
VJK
 
S

Stan Kitsis [MSFT]

<xs:element name="name">

<xs:complexType>

<xs:sequence>

<xs:element name="firstName" type="xs:string"/>

<xs:sequence minOccurs="0">

<xs:element name="middleName" type="xs:string"/>

<xs:element name="lastName" type="xs:string"
minOccurs="0"/>

</xs:sequence>

</xs:sequence>

</xs:complexType>

</xs:element>


--
Stan Kitsis
Program Manager, XML Technologies
Microsoft Corporation

This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm


Hello,


My XML file is as follows:


---------edited section begins-------------
<name>
<firstName>value1</firstName>
<\name>


<name>
<firstName>value1</firstName>
<middleName>value2</middleName­>
<\name>


<name>
<firstName>value1</firstName>
<middleName>value2</middleName­>
<lastName>value3</lastName>
<\name>


---------edited section ends-------------


Could someone emplain, how to write a valid XML schema for this, please
?


Thanks,
VJK
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,999
Messages
2,570,246
Members
46,841
Latest member
WilmerBelg

Latest Threads

Top