OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   Re: [xml-dev] having problems with the "|" in field's element in the xs

[ Lists Home | Date Index | Thread Index ]

Your basic approach is fine.  There are various minor errors in your
schema, and of course it was incomplete.  If I fix all that (see
below), XSV is happy with your instance, and correctly finds an error
if I change the content of the 2nd pickSurfName so it's the same as
the first:

  <invalid char="9" code="cvc-identity-constraint.2.2.3" line="13"
    resource="keyOr.xml">duplicate key (1L, u'LGC', u'C SAND') for
 {http://www.lgc.com/schema/OpenWorksData/2003}Pick_InHierarchy_Key_Definition,
 first appearance was in unnamed entity at line 4 char 9 of keyOr.xml</invalid>

ht

<?xml version='1.0'?>
<xs:schema xmlns:targetns="http://www.lgc.com/schema/OpenWorksData/2003";
 targetNamespace="http://www.lgc.com/schema/OpenWorksData/2003";
 xmlns:xs="http://www.w3.org/2001/XMLSchema";
 elementFormDefault="qualified">

 <xs:element name="PickData" type="targetns:PickData_Type">
   <xs:key name="Pick_InHierarchy_Key_Definition">
    <xs:selector xpath="targetns:Pick"/>
    <xs:field xpath="targetns:pickObsNo"/>
    <xs:field xpath="targetns:DataSrc/targetns:id|targetns:DataSrcRef/targetns:id"/>
    <xs:field xpath="targetns:VcPickSurfName/targetns:pickSurfName"/>
   </xs:key>
  </xs:element>

  <xs:complexType name="PickData_Type">
   <xs:sequence maxOccurs="unbounded">
    <xs:element name="Pick">
     <xs:complexType>
      <xs:sequence>
       <xs:element name="pickObsNo" type="xs:integer"/>
       <xs:choice>
        <xs:element name="DataSrc" type="targetns:DSType"/>
        <xs:element name="DataSrcRef" type="targetns:DSType"/>
       </xs:choice>
       <xs:element name="VcPickSurfName">
        <xs:complexType>
         <xs:sequence>
          <xs:element name="pickSurfName" type="xs:token"/>
         </xs:sequence>
         <xs:attribute name="relationship" type="xs:NCName"/>
        </xs:complexType>
       </xs:element>
      </xs:sequence>  
     </xs:complexType>
    </xs:element>
   </xs:sequence>
  </xs:complexType>

  <xs:complexType name="DSType">
   <xs:sequence>
    <xs:element name="id" type="xs:NCName"/>
   </xs:sequence>
   <xs:attribute name="relationship" type="xs:NCName"/>
  </xs:complexType>
</xs:schema>

ht
-- 
  Henry S. Thompson, HCRC Language Technology Group, University of Edinburgh
    Half-time member of W3C Team
     2 Buccleuch Place, Edinburgh EH8 9LW, SCOTLAND -- (44) 131 650-4440
     Fax: (44) 131 650-4587, e-mail: ht@cogsci.ed.ac.uk
 URL: http://www.ltg.ed.ac.uk/~ht/
 [mail really from me _always_ has this .sig -- mail without it is forged spam]




 

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS