Hi Sandy,
I have read your previous mail. Hope the following will answer all.
Well, I was trying to point a case where a <keyref> refers another <keyref>.
It's not a typo. I know its not legal to have a keyref refer to another keyref,
but, if we have a schema doing this, the current implementation realizes this
very late and flags it by a ClassCastException. This is because, all keyref's
are put in fUnparsedIdentityConstraintRegistry and are processed at the end. So,
when XSDKeyrefTraverser is traversing keyref(A) refering another (or same -
that's why I called it circular reference) keyref(B), XSDHandler.getGlobalDecl()
will successfuly be able to find an entry and return a KeyRef instance trying to
cast to UniqueOrKey, and flags a ClassCastException.
I think if we change the lookup sequence (unparsedregistry -> globalDecl) for a
key being referred, it might help. But, I am not sure. I am still looking into
this.
Cheers,
Rahul.
> From: [EMAIL PROTECTED]
>
> Hi Rahul,
>
> Though I don't think it's a circular reference, it does reveal a bug in our
> current implementation.
>
> When the case you mentioned happens, there must be an error: if a "key" or
> "unique" with the same name "ISBNnumber" exists, then there are more than
> one IDC components with the same name, an error; if a "key" or "unique"
> with that name doesn't exist, then we can't resolve "refer" on "keyref", an
> error too. But currently, we don't report an error.
>
> I'll look more into this. It'd be great too if you could help further on
> this issue.
>
> Thanks,
> Sandy Gao
> Software Developer, IBM Canada
> (1-905) 413-3255
> [EMAIL PROTECTED]
>
> ----- Forwarded by Sandy Gao/Toronto/IBM on 10/24/2001 11:01 AM -----
>
>
> Sandy Gao
>
> To: [EMAIL PROTECTED]
>
> 10/24/2001 cc: [EMAIL PROTECTED]
>
> 10:57 AM From: Sandy Gao/Toronto/IBM@IBMCA
>
> Subject: Re: patch for
XSDKeyrefTraverser(Document link: Sandy Gao)
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> Hi Rahul,
>
> I'm not an expert at IDC, and I'm not sure whether the case you mentioned
> is a circular reference.
>
> From the description of {referenced key}:
> "Required if {identity-constraint category} is keyref, forbidden otherwise.
> An identity-constraint definition with {identity-constraint category} equal
> to key or unique."
>
> So "refer" on "keyref" refers to a "key" or "unique" component, not a
> "keyref" component. Am I right?
>
> I could be wrong. If you still think it's a circular reference, let me
> know. Thx.
>
> Sandy Gao
> Software Developer, IBM Canada
> (1-905) 413-3255
> [EMAIL PROTECTED]
>
>
>
>
>
> Rahul Srivastava
>
> <Rahul.Srivastav To: [EMAIL PROTECTED]
>
> [EMAIL PROTECTED]> cc:
>
> Subject: patch for
XSDKeyrefTraverser
> 10/22/2001 02:48
>
> PM
>
> Please respond
>
> to xerces-j-dev
>
>
>
>
>
>
>
>
>
> Hi,
>
> If a keyref has a declaration:
>
> <xsd:keyref name="ISBNnumber" refer="ISBNnumber">
> ...
> </xsd:keyref>
>
> then its a circular reference, which should not be allowed.
>
> Please find attached a patch for the same.
>
> Cheers,
> Rahul.
>
> Sun Microsystems, Inc.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
> #### patch22_XSDKeyrefTraverser1 has been removed from this note on October
> 24 2001 by Sandy Gao
>
>
>
Sun Microsystems, Inc.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]