Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > XML > Optional attributegroup?

Reply
Thread Tools

Optional attributegroup?

 
 
Nik
Guest
Posts: n/a
 
      04-17-2005
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
 
Reply With Quote
 
 
 
 
Martin Honnen
Guest
Posts: n/a
 
      04-17-2005


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/
 
Reply With Quote
 
 
 
Reply

Thread Tools

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Bind optional one-to-one relationship to textbox Dan Davenport via .NET 247 ASP .Net 0 08-04-2004 01:55 PM
REGEX: capturing on optional groups which fail Charles Shannon Hendrix Perl 0 06-13-2004 11:22 PM
Q: How can I pass UDTs into optional parameters in VB 6.0 ? Ramesh MCSD 3 10-22-2003 06:22 PM
Optional parameters in a VB.net function Do ASP .Net 1 10-16-2003 11:50 AM
Optional Stored Procedure Input Params? Kerri ASP .Net 0 08-12-2003 10:01 PM



Advertisments