XML Schema

Discussion in 'XML' started by VJK, Apr 26, 2005.

  1. VJK

    VJK Guest

    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
     
    VJK, Apr 26, 2005
    #1
    1. Advertising

  2. <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


    "VJK" <> wrote in message
    news:...
    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
     
    Stan Kitsis [MSFT], Apr 29, 2005
    #2
    1. Advertising

  3. VJK

    VJK Guest

    Stan,

    Your answer solved my issue. Thank you very much for your help :)

    VJK
     
    VJK, May 2, 2005
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Markus
    Replies:
    1
    Views:
    1,637
    Markus
    Nov 23, 2005
  2. Fred Smith
    Replies:
    1
    Views:
    983
    Martin Honnen
    Feb 5, 2004
  3. Hari Om
    Replies:
    1
    Views:
    475
    Martin SChukrazy
    Mar 2, 2004
  4. Stanimir Stamenkov
    Replies:
    3
    Views:
    1,312
    Stanimir Stamenkov
    Apr 25, 2005
  5. Replies:
    3
    Views:
    3,077
Loading...

Share This Page