Hi Hugh,

This was already fixed a few days ago, by myself in the CVS, as well as
updates to the SchemaWriter.

Thanks anyway.

--Keith


Hugh Winkler wrote:
> 
> This patch fixes bug: Castor 0.9.4.2 builder generates erroneous xmlName
> for
> top level attributes referenced by an element. I just lifted this code
> from similar code in ElementDecl.java.
> 
> Please see attached testcase.
> 
> Hugh Winkler
> BetweenMarkets Inc.
> 
> ---
> castor-0.9.4.2/src/main/org/exolab/castor/xml/schema/AttributeDecl.java
> Thu Jan 16 18:53:50 2003
> +++
> castor-0.9.4.2-bmi/src/main/org/exolab/castor/xml/schema/AttributeDecl.j
> ava     Fri Jan 31 23:58:35 2003
> @@ -206,9 +206,15 @@
>      **/
>      public String getName(boolean ignoreRef) {
>          if (isReference() && ignoreRef == false) {
> -            return _attributeRef;
> +            String localName = _attributeRef;
> +            //-- check for namespace prefix
> +            int idx = localName.indexOf(':');
> +            if (idx > 0) {
> +                localName = localName.substring(idx+1);
>          }
> -               else return _name;
> +            return localName;
> +        }
> +        return _name;
>      } //-- getName
> 
>      /**
> 
>   ------------------------------------------------------------------------
>                                      Name: castor-attribute-ns-bug.zip
>    castor-attribute-ns-bug.zip       Type: Zip Compressed Data 
>(application/x-zip-compressed)
>                                  Encoding: base64
>                               Description: castor-attribute-ns-bug.zip

----------------------------------------------------------- 
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
        unsubscribe castor-dev

Reply via email to