  We consider a continuous curve of self-adjoint Fredholm extensions of a curve
of closed symmetric operators with fixed minimal domain $D_m$ and fixed {\it
intermediate} domain $D_W$. Our main example is a family of symmetric
generalized operators of Dirac type on a compact manifold with boundary with
varying well-posed boundary conditions. Here $D_W$ is the first Sobolev space
and $D_m$ the subspace of sections with support in the interior. We express the
spectral flow of the operator curve by the Maslov index of a corresponding
curve of Fredholm pairs of Lagrangian subspaces of the quotient Hilbert space
$D_W/D_m$ which is equipped with continuously varying {\it weak symplectic
structures} induced by the Green form.
  In this paper, we specify the continuity conditions; define the Maslov index
in weak symplectic analysis; discuss the required weak inner Unique
Continuation Property; derive a General Spectral Flow Formula; and check that
the assumptions are natural and all are satisfied in geometric and
pseudo-differential context.
  Applications are given to $L^2$ spectral flow formulae; to the splitting of
the spectral flow on partitioned manifolds; and to linear Hamiltonian systems.
