in src/wsdl/org/apache/axis/wsdl/symbolTable/CSchemaUtils.java [1841:1935]
public static Vector getContainedAttributeTypes(Node node,
SymbolTable symbolTable)
{
Vector v = null; // return value
if (node == null)
return null;
// Check for SimpleContent
// If the node kind is an element, dive into it.
if (isXSDNode(node, "element"))
{
NodeList children = node.getChildNodes();
int len = children.getLength();
for (int j = 0; j < len; j++)
{
Node kid = children.item(j);
if (isXSDNode(kid, "complexType"))
{
node = kid;
break;
}
}
}
// Expecting a schema complexType
if (isXSDNode(node, "complexType"))
{
// Under the complexType there could be complexContent/simpleContent
// and extension elements if this is a derived type. Skip over these.
NodeList children = node.getChildNodes();
Node content = null;
int len = children.getLength();
for (int j = 0; j < len; j++)
{
Node kid = children.item(j);
if (isXSDNode(kid, "complexContent") || isXSDNode(kid, "simpleContent"))
{
content = kid;
break;
}
}
// Check for extensions or restrictions
if (content != null)
{
children = content.getChildNodes();
len = children.getLength();
for (int j = 0; j < len; j++)
{
Node kid = children.item(j);
if (isXSDNode(kid, "extension") || isXSDNode(kid, "restriction"))
{
node = kid;
break;
}
}
}
// examine children of the node for <attribute> elements
children = node.getChildNodes();
len = children.getLength();
for (int i = 0; i < len; i++)
{
Node child = children.item(i);
if (isXSDNode(child, "attributeGroup"))
{
if (v == null)
v = new Vector();
addAttributeGroupToVector(v, child, symbolTable);
}
else if (isXSDNode(child, "anyAttribute"))
{
// do nothing right now
if (v == null)
v = new Vector();
}
else if (isXSDNode(child, "attribute"))
{
if (v == null)
v = new Vector();
addAttributeToVector(v, child, symbolTable);
}
}
}
return v;
}