[xsd-users] NoEntry exception from FrontendElements::Context

Ray Lischner rlischner at proteuseng.com
Tue Apr 15 09:16:18 EDT 2014


The exception is thrown from code I added to Code Synthesis, and I am trying to understand the circumstances in which the problem arises.

The schema is as follows:

<schema xmlns=http://www.w3.org/2001/XMLSchema>
 <complexType name="T">
  <sequence>
   <choice>
    <sequence>
     <element name="a" type="int"/>
     <element name="b" type="int"/>
    </sequence>
    <sequence>
      <element name="b" type="int"/>
    </sequence>
   </choice>
 </sequence>
</schema>

The schema is simplified from the real schema and seems to be the minimum needed to manifest the problem, which is that when traversing the semantic graph in xsd/cxx/tree/tree-header.cxx, I dispatch to a new class:

struct MyClass : Traversal::Element, // several other Traversal classes
{
  Void traverse (SemanticGraph::Element& e) {
    if (min (e) == 0) // throws FrontendElements::NoEntry when traversing the second "b" element
      do_something();
  }
};

If I change the name of the second "b" element to "c", the problem goes away and every element has a min and max. If I change the name of the first "b" to "c", the problem goes away.

I know this example schema can be rewritten without the <choice>, but the real schema from this is derived cannot. The branches of the <choice> are more complicated.

So my question is, in what circumstances does an element lack a "min" or "max" in its context? And what should I do about it?


Ray Lischner,
Distinguished Member of Technical Staff
133 National Business Pkwy, Ste 150     t. 443.539.3448
Annapolis Junction, MD 20701            c. 410.854.9787
rlischner at proteuseng.com                f. 443.539.3370


More information about the xsd-users mailing list