Could someone familiar with ws-commons XmlSchema look into this?

I encountered a problem with SchemaBuilder.handleElement on a xsd:element
that uses the 'ref' attribute.  The handleElement method creates a QName,
but the QName constructor throws an exception if the local name arg is
null. In my test case, the element has no 'name' attribute (it uses 'ref'
instead) and the method passes a null value to the QName constructor.

The test case wsdl is http://www.uddi.org/schema/uddi_v2.xsd

The xsd:element is:
...
...
<xsd:complexType name="address">
    <xsd:sequence>
        <xsd:element ref="uddi:addressLine" minOccurs="0"
maxOccurs="unbounded"/>
        ...


SchemaBuilder.handleElement(..)
    ....
    if (el.getAttributeNode("name") != null)
        element.name = el.getAttribute("name");
    ....
    element.qualifiedName = new QName(ns, element.name);   <<- element.name
is null here!


Stack trace:

java.lang.IllegalArgumentException: local part cannot be "null" when
creating a QName
      at javax.xml.namespace.QName.<init>(Unknown Source)
      at javax.xml.namespace.QName.<init>(Unknown Source)
      at
org.apache.ws.commons.schema.SchemaBuilder.handleElement(SchemaBuilder.java:1409)
      at
org.apache.ws.commons.schema.SchemaBuilder.handleSequence(SchemaBuilder.java:973)
      at
org.apache.ws.commons.schema.SchemaBuilder.handleComplexType(SchemaBuilder.java:550)
      at
org.apache.ws.commons.schema.SchemaBuilder.handleXmlSchemaElement(SchemaBuilder.java:96)
      at
org.apache.ws.commons.schema.XmlSchemaCollection.read(XmlSchemaCollection.java:132)

thanks,
John Kaputin

Reply via email to