TWSDLParserContextImpl context,
Definitions definitions,
Element e) {
context.push();
context.registerNamespaces(e);
Import anImport = new Import(forest.locatorTable.getStartLocation(e));
String namespace =
Util.getRequiredAttribute(e, Constants.ATTR_NAMESPACE);
anImport.setNamespace(namespace);
String location = Util.getRequiredAttribute(e, Constants.ATTR_LOCATION);
anImport.setLocation(location);
// according to the schema in the WSDL 1.1 spec, an import can have a documentation element
boolean gotDocumentation = false;
for (Iterator iter = XmlUtil.getAllChildren(e); iter.hasNext();) {
Element e2 = Util.nextElement(iter);
if (e2 == null)
break;
if (XmlUtil.matchesTagNS(e2, WSDLConstants.QNAME_DOCUMENTATION)) {
if (gotDocumentation) {
errReceiver.error(forest.locatorTable.getStartLocation(e), WsdlMessages.PARSING_ONLY_ONE_DOCUMENTATION_ALLOWED(e.getLocalName()));
}
gotDocumentation = true;
anImport.setDocumentation(getDocumentationFor(e2));
} else {
errReceiver.error(forest.locatorTable.getStartLocation(e2), WsdlMessages.PARSING_INVALID_ELEMENT(e2.getTagName(),
e2.getNamespaceURI()));
}
}