}
String gapname = s.getGapName();
if (tgap)
g.addOpenTemplateGap(gapname);
if (agap)
g.addOpenAttributeGap(gapname);
if (s.getSchema() != null) {
if (g.getGapTypeMap().get(gapname) != null &&
!g.getGapTypeMap().get(gapname).equals(s.getSchema().getType()))
throw new XMLAnalysisException("Different types of gap '" + gapname + "'", s.getOrigin());
g.getGapTypeMap().put(gapname, s.getSchema().getType());