Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: constraints on attributes as a validation check (ish)

From: Boris Kolpackov <boris@-------------.--->
To: Andy Harris <andy.harris@---------.--.-->
Date: 9/2/2007 10:03:00 PM
Hi Andy,

Andy Harris <andy.harris@u...> writes:

> <root>
>     <row typ="g01">
>         <r>content1a</r>
>         <r>content1b</r>
>     </row>
>     <row typ="g02">
>         <r>content2a</r>
>         <r>content2b</r>
>     </row>
>     <row typ="g03">
>         <r>content3a</r>
>         <r>content3b</r>
>     </row>
>     <row type="g05">
>         <r>content4a</r>
>         <r>content4b</r>
>         <r>content4c</r>
>     </row>
> </root>
>
> I need to verify that each file contains one and one only row element of
> type="g04".

This is called co-occurrence constraint and is not supported in the
current revision of XML Schema. Unless you can implement this check
in your application, your best bet is to use element names to carry
type information, e.g.:

<root>
  <row-g05>
    ...
  </row-g05>
</root>

Then you can use the standard XML Schema techniques to restrict the
number of occurrences of this element.

Boris

-- 
Boris Kolpackov
Code Synthesis Tools CC
http://www.codesynthesis.com
Open-Source, Cross-Platform C++ XML Data Binding

From boris@c... Mon Sep 03 10:22:23 2007
Received: from lisa.w3.org ([128.30.52.41


transparent
Print
Mail
Like It
Disclaimer
.

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.

.
.

transparent

transparent