I am strugling with understanding key:keyref in xml.
My structure
<Regions>
<Region Name="Simple region name">
<NumberOfWineries>3</NumberOfWineries>
<Winery Name="Simple winery">
<City>Simple city</City>
<Owner>Simple owner</Owner>
<Image photo="img_winary"/>
<NumberOfDiffrentWines>2</NumberOfDiffrentWines>
<Wines>
<Wine Name="Cool wine" Vintage="2003">
<Characteristics>
<Color>blue</Color>
</Characteristics>
</Wine>
</Wines>
</Winery>
</Region>
<Region....>
.....
</Region>
</Regions>
Here I am strugling with making key:keyref from wine to winery.
I was thinking of making an unique id of winery and refering to that id for every wine.
Something like
<winery id="1" />
<wine idref="1" />
It is not so clear to me, can someone guide me if I am going on a wrong path.
Thank you in advance.
Code exmaple is following, some details are omitted:
Some important notes:
keyandkeyrefin the body of elementYou can find more examples and explanation in my xsd tutorial.