[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: having problems with the "|" in field's element inthe xs:
my broad understanding is: W3C XML-Schema requires that each field expression return one and exactly one value. If we use | it may not be able to ensure this. I would assume that | is not allowed to be part of field.. Hopefully others well versed with the spec well will answer.. regards - murali. On Tue, 20 May 2003, Bill Riegel wrote: > > Using Xerces 2.4, > My intension is to define a unique key from the PickData level. Should > Keys are > Pick/pickObsNo > Pick/DataSrc/id or Pick/DataSrcRef/id > Pick/VcPickSurfName/pickSurfName > > > Parser fails; complains my constraint failed. If I have a DataSrc in one > Pick and a DataSrcRef in the other. > > Parser Error: Not enough values specified for <key > name="Pick_InHierarchy_Key_Definition"> identity constraint specified for > element "PickData". > > > If I have a DataSrc in both Picks, all is ok. > > > Is the "|" an or ? > Can I use the "|" in this way. > > > <xs:schema xmlns:targetns=http://www.lgc.com/schema/OpenWorksData/2003 > <http://www.lgc.com/schema/OpenWorksData/2003> > > > <xs:element name="PickData" type="PickData_Type" minOccurs="0"> > <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:schema > > instance document > > <DataSet xmlns=http://www.lgc.com/schema/OpenWorksData/2003 > <http://www.lgc.com/schema/OpenWorksData/2003> > > > <PickData> > <Pick> > <pickObsNo>1</pickObsNo> > <DataSrc relationship="pickBy"> > <id>LGC</id> > </DataSrc> > <VcPickSurfName relationship="pickName"> > <pickSurfName>C SAND</pickSurfName> > </VcPickSurfName> > </Pick> > <Pick> > <pickObsNo>1</pickObsNo> > <DataSrcRef relationship="pickBy"> > <id>LGC</id> > </DataSrcRef> > <VcPickSurfName relationship="pickName"> > <pickSurfName>BASE-POROSITY-C SAND</pickSurfName> > </VcPickSurfName> > </Pick> > </PickData> > </DataSet> > > Bill Riegel > LandMark Graphics > 713-839-3388 > >
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|