"</xs:schema>\n";
JAXBParser parser = newJAXBParser();
InputSource isource = new InputSource(new StringReader(schemaSource1));
isource.setSystemId("testTargetNamespace1.xsd");
XSSchema schema = parser.parse(isource);
XSElement[] elements = schema.getElements();
assertEquals(3, elements.length);
XsQName headName = new XsQName("http://test.com/namespaces", "head");
XsQName subst1Name = new XsQName("http://test.com/namespaces", "subst1");
XsQName subst2Name = new XsQName("http://test.com/namespaces", "subst2");
assertEquals(headName, elements[0].getName());
assertNotNull(elements[0].getSubstitutionGroup());
assertNull(elements[0].getSubstitutionGroupName());
assertEquals(subst1Name, elements[1].getName());
assertNull(elements[1].getSubstitutionGroup());
assertEquals(headName, elements[1].getSubstitutionGroupName());
assertEquals(subst2Name, elements[2].getName());
assertNull(elements[2].getSubstitutionGroup());
assertEquals(headName, elements[2].getSubstitutionGroupName());
XSType[] types = schema.getTypes();
assertEquals(1, types.length);
XSGroup group = assertGroup(assertComplexContent(assertComplexType(types[0])));
XSParticle[] particles = group.getParticles();
assertEquals(1, particles.length);
XSGroup substitutedGroup = assertGroup(particles[0]);