You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xmlbeans.apache.org by hong zhang <hz...@gmail.com> on 2004/10/28 22:34:50 UTC

key and keyref support

I am in the process of evaluating XMLBean. It looks pretty good to me.
I have a question regarding <keyref and <key.
Here's a portion of my schema:
		<xsd:key name="itemKey">
			<xsd:selector xpath="./items/item"/>
			<xsd:field xpath="@code"/>
		</xsd:key>
		<xsd:keyref name="NoIllegalEntries" refer="itemKey">
			<xsd:selector xpath="./aisle/itemref"/>
			<xsd:field xpath="@code"/>
		</xsd:keyref>
And here's portion of the XML file:
	<aisle name="fruits" number="1">		
		<itemref code="003" quantity="60" price="3.15"/>
	</aisle>
My question is:
.When I iterate to the  code attribute of <itemref, how can I know
it's a keyref instead of just a normal attribute? I tried to use
XMLObject.schemaType(), but it doesn't contain that information?
Also, how can I get the reference to key, by XMLObject.execute()?

Any input will be highly appreciated.

Hong

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: dev-help@xmlbeans.apache.org