Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: troubles designing schema

From: George Cristian Bina <george@---------.--->
To: Eddie Kawas <edward.kawas@-----.--->
Date: 6/29/2005 9:25:00 AM
Hi Eddie,

You can define an unique constraint on the BasicGFFSequenceFeature 
element to check that the moby:articleName of the moby:String, 
moby:Float or moby:Integer are unique and couple that with defining the 
exact number of occurances for these elements in the content model, 
something like below:

   <xs:element name="BasicGFFSequenceFeature">
     <xs:complexType>
       <xs:sequence>
         <xs:element ref="moby:multi_key_value_pair"/>
         <xs:choice maxOccurs="9" minOccurs="9">
           <xs:element ref="moby:String"/>
           <xs:element ref="moby:Float"/>
           <xs:element ref="moby:Integer"/>
         </xs:choice>
       </xs:sequence>
     </xs:complexType>
     <xs:unique name="test">
       <xs:selector xpath="moby:String|moby:Float|moby:Integer"/>
       <xs:field xpath="@moby:articleName"/>
     </xs:unique>
   </xs:element>

Hope that helps,
George
------------------------
George Cristian Bina
www.---.com

Eddie Kawas wrote:
> Hi,
> 
> I have an XML document that has elements in it that have the
> same tagname, but different mandatory values for the
> attributes. I am having one heck of a time trying to design
> a schema for these types of documents.
> 
> An example of the type of xml I am trying to develop a
> schema for is below:
> 
> <moby:BasicGFFSequenceFeature>
>     <moby:multi_key_value_pair
> moby:articleName="column9_tag_value" moby:id=""
> moby:namespace="">
>         <moby:String moby:articleName="value" moby:id=""
> moby:namespace=""/>
>         <moby:String moby:articleName="key" moby:id=""
> moby:namespace=""/>
>     </moby:multi_key_value_pair>
>     <moby:String moby:articleName="reference" moby:id=""
> moby:namespace=""/>
>     <moby:String moby:articleName="source" moby:id=""
> moby:namespace=""/>
>     <moby:String moby:articleName="method" moby:id=""
> moby:namespace=""/>
>     <moby:Integer moby:articleName="start" moby:id=""
> moby:namespace=""/>
>     <moby:Integer moby:articleName="stop" moby:id=""
> moby:namespace=""/>
>     <moby:Float moby:articleName="score" moby:id=""
> moby:namespace=""/>
>     <moby:String moby:articleName="strand" moby:id=""
> moby:namespace=""/>
>     <moby:String moby:articleName="frame" moby:id=""
> moby:namespace=""/>
>     <moby:String moby:articleName="phase" moby:id=""
> moby:namespace=""/>
> </moby:BasicGFFSequenceFeature>
> 
> As you can see, the tagname is repetitive, but the
> articleNames, which are fixed, are different. Moreover, the
> number of elements is important as well, so you would always
> see all of the elements together or not at all.
> 
> Can this be done? If so, how? What am I missing?
> 
> Thanks way in advance for any insight.
> 
> Eddie Kawas
> 
> 
> 
> 
> 



transparent
Print
Mail
Digg
delicious
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