Optional attributegroup?

Discussion in 'XML' started by Nik, Apr 17, 2005.

  1. Nik

    Nik Guest

    Hello,

    I'm writing a validation schema for some XML and I wonder if there is
    a good way to validate the following scenario:

    The element:

    <foo bar.1="1" bar.2="2" bar.4="4" tar="3"/>

    The entire element is optional but that can be handled with
    min/maxoccurs. The problem is the bar.* attributes. How can I define
    that e.g. bar.[1-4] are optional but if any one of them are present
    then the others should be present too?

    Thanks in advance
    Nik, Apr 17, 2005
    #1
    1. Advertising

  2. Nik wrote:


    > I'm writing a validation schema for some XML and I wonder if there is
    > a good way to validate the following scenario:
    >
    > The element:
    >
    > <foo bar.1="1" bar.2="2" bar.4="4" tar="3"/>
    >
    > The entire element is optional but that can be handled with
    > min/maxoccurs. The problem is the bar.* attributes. How can I define
    > that e.g. bar.[1-4] are optional but if any one of them are present
    > then the others should be present too?


    In my view neither a DTD nor a W3C XML schema allows you to model such a
    constraints involving different attributes.

    --

    Martin Honnen
    http://JavaScript.FAQTs.com/
    Martin Honnen, Apr 17, 2005
    #2
    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. Dan Davenport via .NET 247

    Bind optional one-to-one relationship to textbox

    Dan Davenport via .NET 247, Aug 4, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    625
    Dan Davenport via .NET 247
    Aug 4, 2004
  2. Charles Shannon Hendrix

    REGEX: capturing on optional groups which fail

    Charles Shannon Hendrix, Jun 14, 2004, in forum: Perl
    Replies:
    0
    Views:
    542
    Charles Shannon Hendrix
    Jun 14, 2004
  3. Kerri
    Replies:
    0
    Views:
    339
    Kerri
    Aug 12, 2003
  4. Do
    Replies:
    1
    Views:
    67,119
    Kevin Spencer
    Oct 16, 2003
  5. ruca

    Optional and have default value

    ruca, Apr 12, 2004, in forum: ASP .Net
    Replies:
    3
    Views:
    420
    Marina
    Apr 12, 2004
Loading...

Share This Page