XML.orgXML.org
FOCUS AREAS |XML-DEV |XML.org DAILY NEWSLINK |REGISTRY |RESOURCES |ABOUT
OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]
Re: [xml-dev] key and keyref issues

The elements in the source document are all in a namespace but the path expressions in your key definitions are looking for elements in no namespace.

Michael Kay
Saxonica

On 30 May 2018, at 16:33, John Dziurlaj <john@hiltonroscoe.com> wrote:

I’m attempting to constrain a schema, which has a lot of xsd:ID and xsd:IDREF, so that, for example, a Person IDREF can only refer to a Person ID. 

 

I wrote a key and keyref constraint thus:

 

<xsd:element name="ElectionReport" type="ElectionReport">
      <xsd:key name="personKey">
           <xsd:selector xpath="./Person"/>
           <xsd:field xpath="@ObjectId"/>
      </xsd:key>
      <xsd:keyref name="personKeyRef" refer="personKey">
           <xsd:selector xpath="./Election/Candidate"/>
           <xsd:field xpath="PersonId"/>
      </xsd:keyref>
</xsd:element>

 

However, when I try it against an example I wrote up (which should throw a validation error), it succeeds with no errors.

I’ve attached both my schema and example file. I am using XMLSpy to validate my instances.

 

Thanks,

 

John Dziurlaj

 

Elections Consultant
Hilton Roscoe LLC
Cell 330-714-8935 Work/Fax 234-706-6434

 

<idc_test.xml><NIST_V2_election_results_reporting.xsd>_______________________________________________________________________

XML-DEV is a publicly archived, unmoderated list hosted by OASIS
to support XML implementation and development. To minimize
spam in the archives, you must subscribe before posting.

[Un]Subscribe/change address: http://www.oasis-open.org/mlmanage/
Or unsubscribe: xml-dev-unsubscribe@lists.xml.org
subscribe: xml-dev-subscribe@lists.xml.org
List archive: http://lists.xml.org/archives/xml-dev/
List Guidelines: http://www.oasis-open.org/maillists/guidelines.php



[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]


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

Copyright 1993-2007 XML.org. This site is hosted by OASIS