void () { XmlNSDescriptor NSDescriptor = createDescriptor( "<xsd:schema targetNamespace=\"http://www.deansoft.com/AddressBook\" xmlns:ab=\"http://www.deansoft.com/AddressBook\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\">" + "<xsd:element name=\"purchaseOrder\">" + "<xsd:complexType name=\"PurchaseOrderType\">" + " <xsd:sequence>" + " <xsd:element ref=\"shipTo\"/>" + " </xsd:sequence>" + "</xsd:complexType>" + "</xsd:element>" + "<xsd:element name=\"shipTo\" abstract=\"true\">" + " <xsd:complexType name=\"USAddress\">" + " <xsd:attribute name=\"orderDate\" type=\"xsd:date\"/>" + " <xsd:element name=\"items\" type=\"Items\"/>" + " </xsd:complexType>" + "</xsd:element>" + "<xsd:element name=\"name\" substitutionGroup=\"ab:shipTo\"/>" + "</xsd:schema>"); XmlTag tag = XmlTestUtil.tag("purchaseOrder", "http://www.deansoft.com/AddressBook", getProject()); XmlElementDescriptor elementDescriptor = NSDescriptor.getElementDescriptor(tag); final XmlElementDescriptor[] elements = elementDescriptor.getElementsDescriptors(tag); assertEquals(1, elements.length); assertEquals("name", elements[0].getName()); XmlAttributeDescriptor[] attrs = elements[0].getAttributesDescriptors(tag); assertEquals(1, attrs.length); assertEquals("orderDate", attrs[0].getName()); XmlElementDescriptor[] element0Descriptors = elements[0].getElementsDescriptors(tag.findFirstSubTag(elements[0].getName())); assertEquals(1, element0Descriptors.length); assertEquals("items", element0Descriptors[0].getName()); }