 |
 |
 |
Steve Fletcher <ste.fletch@g...> wrote in
<4398c444-76a8-4ea3-a3ba-1f43a55cb323@s...>:
> I'm writing a schema, and I want to apply some contraints
> to the combination of values that can be supplied for the
> attributes for one of the elements. The problem concerns
> the Operation element in the xml fragment below. The
> element has two attrbiutes, and I want to apply some rules
> that ensure that the values provided are in agreement with
> one another. For example, I want ensure the CREATE, UPDATE
> and DELETE values for the Operation attribute are provided
> with a Sequence number, but that the CREATEUPDATE value of
> Operation attribute is not have a Sequence Number
> provided.
>
> I want to <b>allow</b> only the following combinations:
Note that HTML markup is inappropriate in a Content-Type:
text/plain; charset=ISO-8859-1 document.
> <ns1:Operation Operation='CREATE' Sequence=(any +ve int)/>
> <ns1:Data>Data</ns1:Data>
> ...
> <ns1:Operation Operation="UDPATE' Sequence=(any +ve int)/>
> <ns1:Data>Data</ns1:Data>
> ...
> <ns1:Operation Oprtation='DELETE' Sequence=(any +ve int)/>
> <ns1:Data>Data</ns1:Data>
> ...
> <ns1:Operation Operation='CREATEUPDATE'/>
> <ns1:Data>Data</ns1:Data>
>
> but <b>prevent<b/> the following xml
> <ns1:Operation Operation='CREATEUPDATE' Sequence=(any +ve
> int)/> <ns1:Data>Data</ns1:Data>
>
> Does anyone know how this is achieved?
There's a number of traditional ways of dealing with
requirements like this.
1). Use <create>, <update>, <delete> and <createupdate>
elements instead of a generic <Operation> element.
2). Check on the application side.
3). Use a more powerful schema definition language, such
as RELAX NG or Schematron constraint checking
language.
By the way, just wondering, - are your <Data> elements
supposed to provide additional information about the
preceding <Operation> element?
--
<>There is no phenotype</>
|
 | 

|  |
These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.
|  |
| |
 |
 |
 |