- From: Zhangxiangli <xianglizhang@precomtech.com>
- Date: Fri, 14 Dec 2001 19:05:50 -0000
- To: <www-xml-schema-comments@w3.org>
- Message-ID: <00e801c1848f$4bc81c80$7f00a8c0@xianglizhang>
Hello: I currently have some puzzles on the keyref definition according to the recommendation pulished in 2 May 2001 . I write a schema that has 6 complexType A B1 B2 C D E, B1,B2 extension A, and C,D extension B1, class A,B1 are abstract type, and I create two element: A and E. as following: A | ------ | | E B1 B2 | ------ | | C D Here is my problem: I want to create a keyref that reference parts of A's instance, suppose only for instance of B1 subtree, not for B2? I think the definition should be somthing like: <xsd:key name="A_PK"> <xsd:selector xpath="A[@xsi:type='C'|@xsi:type='D']"/> <xsd:field xpath="a1"/> </xsd:key> <xsd:keyref name='E_FK" refer="A_PK"> <xsd:selector xpath="E"/> <xsd:field xpath="a1"/> </xsd:keyref> but according to recomendation, in "selector" "xpath" condition expression such as"[]" does not supported, How can I write such keyref constraints? Hope for your reply. My sample schema and xml document is in the attachment. bests regards. thanks a lot. xiangli zhang
Attachments
- text/xml attachment: sample.xsd
- text/xml attachment: Sample.xml
Received on Friday, 14 December 2001 05:48:17 UTC