You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by di...@apache.org on 2002/12/27 00:24:30 UTC

cvs commit: xml-axis/java/src/org/apache/axis/wsdl/symbolTable SchemaUtils.java

dims        2002/12/26 15:24:29

  Modified:    java/src/org/apache/axis/wsdl/symbolTable SchemaUtils.java
  Log:
  Allow "restriction" under "simpleContent". Needed for GroupG dime/rpc Interop test.
  
  Revision  Changes    Path
  1.20      +8 -7      xml-axis/java/src/org/apache/axis/wsdl/symbolTable/SchemaUtils.java
  
  Index: SchemaUtils.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/wsdl/symbolTable/SchemaUtils.java,v
  retrieving revision 1.19
  retrieving revision 1.20
  diff -u -r1.19 -r1.20
  --- SchemaUtils.java	11 Dec 2002 22:38:29 -0000	1.19
  +++ SchemaUtils.java	26 Dec 2002 23:24:29 -0000	1.20
  @@ -141,20 +141,21 @@
               if (simpleContent != null) {
                   children = simpleContent.getChildNodes();
                   for (int j = 0; j < children.getLength() && extension == null; j++) {
  -                    QName extensionKind = Utils.getNodeQName(children.item(j));
  -                    if (extensionKind != null &&
  -                        extensionKind.getLocalPart().equals("extension") &&
  -                        Constants.isSchemaXSD(extensionKind.getNamespaceURI())) {
  +                    QName extensionOrRestrictionKind = Utils.getNodeQName(children.item(j));
  +                    if (extensionOrRestrictionKind != null &&
  +                        (extensionOrRestrictionKind.getLocalPart().equals("extension") ||
  +                         extensionOrRestrictionKind.getLocalPart().equals("restriction")) &&
  +                        Constants.isSchemaXSD(extensionOrRestrictionKind.getNamespaceURI())) {
                           
  -                        // get the type of the extension from the "base" attribute
  -                        QName extendsType =
  +                        // get the type of the extension/restriction from the "base" attribute
  +                        QName extendsOrRestrictsType =
                               Utils.getTypeQName(children.item(j), new BooleanHolder(), false);
                           
                           // Return an element declaration with a fixed name
                           // ("value") and the correct type.                        
                           Vector v = new Vector();
                           ElementDecl elem = new ElementDecl();
  -                        elem.setType(symbolTable.getTypeEntry(extendsType, false));
  +                        elem.setType(symbolTable.getTypeEntry(extendsOrRestrictsType, false));
                           elem.setName(new javax.xml.namespace.QName("", "value"));
                           v.add(elem);
                           return v;