XSD help

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Peter Morris [Droopy eyes software]

    #1

    XSD help

    Hi all

    I have a config file like so

    <config>
    <optionSet1>
    <option index="1" name="Set 1 index 1"/>
    </optionSet1>
    <optionSet1>
    <option index="1" name="Set 2 index 2"/>
    </optionSet1>
    </config>


    optionSet1-index1 can only have set values 1, 3, 5, 7

    How do I define XSD for optionSet2-index1 so that

    if optionSet1-index1 is in 1, 5 then it must be null
    if optionSet1-index1 == 3 then it must be A or B
    if optionSet1-index1 == 7 then it must be B, C or D


    Thank you very much!

    Pete


  • Stan Kitsis [MSFT]

    #2
    Re: XSD help

    Hi Peter,

    You cannot do this using Xml Schema - it does not have this type of
    co-occurance constraints.

    --
    Stan Kitsis
    Program Manager, XML Technologies
    Microsoft Corporation

    This posting is provided "AS IS" with no warranties, and confers no rights.


    "Peter Morris [Droopy eyes software]" <pete@droopyeye s.no.com.spam> wrote in
    message news:uILbq6plGH A.4212@TK2MSFTN GP03.phx.gbl...[color=blue]
    > Hi all
    >
    > I have a config file like so
    >
    > <config>
    > <optionSet1>
    > <option index="1" name="Set 1 index 1"/>
    > </optionSet1>
    > <optionSet1>
    > <option index="1" name="Set 2 index 2"/>
    > </optionSet1>
    > </config>
    >
    >
    > optionSet1-index1 can only have set values 1, 3, 5, 7
    >
    > How do I define XSD for optionSet2-index1 so that
    >
    > if optionSet1-index1 is in 1, 5 then it must be null
    > if optionSet1-index1 == 3 then it must be A or B
    > if optionSet1-index1 == 7 then it must be B, C or D
    >
    >
    > Thank you very much!
    >
    > Pete
    >[/color]


    Comment

    • Peter Morris [Droopy eyes software]

      #3
      Re: XSD help

      Hi Stan
      [color=blue]
      > You cannot do this using Xml Schema - it does not have this type of
      > co-occurance constraints.[/color]

      Thanks for the answer. I think this is a shame, XSD could have been an
      excellent means of specifying user input + validation for thin clients.



      --
      Pete
      ====
      Audio compression components, DIB graphics controls, ECO extensions,
      FastStrings


      My blog



      Comment

      • Peter Flynn

        #4
        Re: XSD help

        Peter Morris [Droopy eyes software] wrote:[color=blue]
        > Hi Stan
        >[color=green]
        >> You cannot do this using Xml Schema - it does not have this type of
        >> co-occurance constraints.[/color]
        >
        > Thanks for the answer. I think this is a shame, XSD could have been an
        > excellent means of specifying user input + validation for thin clients.[/color]

        That role was delegated to XML Forms.

        ///Peter

        Comment

        • Priya Lakshminarayanan

          #5
          Re: XSD help

          You can embed Schematron rules in an XSD schema to specify co-occurrence
          constraints and layer over XSD validation. For more information on
          schematron,
          take a look at:

          www.XML.com,Textuality Services,Chimezie Ogbuji,Metadata, Programming, Vocabularies,Validating XML with Schematron


          Thanks,
          Priya

          "Peter Morris [Droopy eyes software]" <pete@droopyeye s.no.com.spam> wrote in
          message news:Owm5grHmGH A.4768@TK2MSFTN GP03.phx.gbl...[color=blue]
          > Hi Stan
          >[color=green]
          >> You cannot do this using Xml Schema - it does not have this type of
          >> co-occurance constraints.[/color]
          >
          > Thanks for the answer. I think this is a shame, XSD could have been an
          > excellent means of specifying user input + validation for thin clients.
          >
          >
          >
          > --
          > Pete
          > ====
          > Audio compression components, DIB graphics controls, ECO extensions,
          > FastStrings
          > http://www.droopyeyes.com
          >
          > My blog
          > http://blogs.slcdug.org/petermorris/
          >[/color]


          Comment

          • Peter Morris [Droopy eyes software]

            #6
            Re: XSD help

            > That role was delegated to XML Forms.

            What do you mean?


            Comment

            Working...