Hello,

I'm trying to find a way to access the annotations of individual
enumeration members using the PSVI api. My initial approach was to match up
values from the lists returned
from XSMultiValueFacet::getLexicalFacetValues()
and XSMultiValueFacet::getAnnotations() by index. However this won't work
in cases when the schema does not specify annotations for all enumeration
members, e.g. like this:

<restriction base="string">
  <enumeration value="1">
    <annotation>
      <documentation>one</documentation>
    </annotation>
  </enumeration>
  <enumeration value="2"/>
  <enumeration value="3">
    <annotation>
      <documentation>three</documentation>
    </annotation>
  </enumeration>
</restriction>

In such scenario, the lexical facet list has 3 elements, while the
annotation list has 2 elements and it's not possible to tell which
annotation belongs to which facet.

Is it a bug/limitation of the XSMultiValueFacet interface, or is there a
way to achieve this?

Our application is dealing with third party XSDs, so fixing the schema to
specify annotations for all enumeration values is not an option,
unfortunately.

Thanks in advance,
Wojciech.

Reply via email to