You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-dev@xerces.apache.org by Glenn Ammons <am...@us.ibm.com> on 2005/11/09 18:41:08 UTC

getName returns null for anonymous types

I'm sorry if this is a known bug, but the bug repository at

  http://issues.apache.org/jira/browse/XERCESJ

appears to be down.

The problem is that getName() returns null for anonymous types.  I
consider this a bug because the specification at

  http://www.w3.org/Submission/2004/SUBM-xmlschema-api-20040122/xml-schema-api.html

says

  For anonymous types, the processor must construct and expose an
  anonymous type name that is distinct from the name of every named
  type and the name of every other anonymous type.

It appears that Xerces obeys the "construct" part but falls down on
the "expose" part.  The culprit is

  src/org/apache/xerces/impl/xs/XSComplexTypeDecl.java

which contains this:

  public String getName() {
      return getAnonymous() ? null : fName;
  }

I think that it ought to read

  public String getName() {
      return fName;
  }

Thanks.
--glenn


---------------------------------------------------------------------
To unsubscribe, e-mail: j-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: j-dev-help@xerces.apache.org


Re: getName returns null for anonymous types

Posted by Michael Glavassevich <mr...@ca.ibm.com>.
Hi Glenn,

Good catch. Seems the API and the implementation got out of synch here [1] 
shortly before the XML Schema API was published. The fix you're suggesting 
is correct. I need to check what affect it will have on other parts of the 
code before applying it.

Thanks.

[1] 
http://svn.apache.org/viewcvs.cgi/xerces/java/trunk/src/org/apache/xerces/xs/XSObject.java?rev=319493&r1=319491&r2=319493&diff_format=h

Michael Glavassevich
XML Parser Development
IBM Toronto Lab
E-mail: mrglavas@ca.ibm.com
E-mail: mrglavas@apache.org

Glenn Ammons <am...@us.ibm.com> wrote on 11/09/2005 12:41:08 PM:

> I'm sorry if this is a known bug, but the bug repository at
> 
>   http://issues.apache.org/jira/browse/XERCESJ
> 
> appears to be down.
> 
> The problem is that getName() returns null for anonymous types.  I
> consider this a bug because the specification at
> 
>   http://www.w3.org/Submission/2004/SUBM-xmlschema-api-20040122/xml-
> schema-api.html
> 
> says
> 
>   For anonymous types, the processor must construct and expose an
>   anonymous type name that is distinct from the name of every named
>   type and the name of every other anonymous type.
> 
> It appears that Xerces obeys the "construct" part but falls down on
> the "expose" part.  The culprit is
> 
>   src/org/apache/xerces/impl/xs/XSComplexTypeDecl.java
> 
> which contains this:
> 
>   public String getName() {
>       return getAnonymous() ? null : fName;
>   }
> 
> I think that it ought to read
> 
>   public String getName() {
>       return fName;
>   }
> 
> Thanks.
> --glenn
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: j-dev-unsubscribe@xerces.apache.org
> For additional commands, e-mail: j-dev-help@xerces.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: j-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: j-dev-help@xerces.apache.org