I have a XSD file like below:
<element name="finder-def" minOccurs="0" maxOccurs="unbounded">
<complexType>
<attribute name="name" type="string" use="required"></attribute>
<attribute name="description" type="string"></attribute>
<attribute name="class" type="string" use="required"></attribute>
</complexType>
</element>
<complexType name="Dimension">
<sequence>
<element name="finder" type="Finder" minOccurs="0" maxOccurs="1"/>
</sequence>
</complexType>
<complexType name="Finder">
<attribute name="name" type="String" use="required"/>
</complexType>
XML file corresponds to above XSD file is below:
<finder-def name="circleFinder" description="Finds circle based on msisdn" class="com.onmobile.reporting.etl.processor.common.propertyplugins.CircleIdPropertyPlugin" />
<dimension name="circleId">
<finder name="circleFinder" />
</dimension>
So, here I have defined one finder-def i.e. circleFinder and then want to refer to this finder-def through finder element.
So the question is How can I validate that finder circleFinder has its defination defined above in finder-def
Just another way to use ID and IDREF types inside schema.
Example:
Sample XML:
XSD schema (I’ve formatted it a bit to validate)