private boolean isComplexContentValidlyDerived(ComplexTypeComplexContent ct1, ComplexTypeComplexContent ct2) {
    ComplexTypeComplexContentExtension ex = complexTypeSelector.transformComplexContent(ct2);
    String base = ex.getBase();
    if (base == null || ex.getParticle() != null || !ex.getAttributeUses().equals(AttributeGroup.EMPTY) || ex.isMixed())
      return false;
    Particle particle = ct1.getParticle();
    for (;;) {
      String tem = complexTypeSelector.particleBase(particle);
      if (base.equals(tem))
        return true;
      if (tem == null)
        break;
      if (!complexTypeSelector.isComplexType(tem))
        break;
      particle = schema.getGroup(tem).getParticle();
    }
    return false;
  }