users@jaxb.java.net

RE: UnmarshallException, unexpected attributes, inconsistent gene rate d classes across namespaces.

From: Poccachard, Ian AG <ian.poccachard_at_rolls-royce.com>
Date: Tue, 9 Dec 2003 14:10:08 -0000

> Looking at your schema, it should work fine with the separate
> compilation, so it starts to seem like a bug.
>
> However, I didn't spot any difference in the enterAttribute callback
> (but I found some difference in enterElement and leaveElement). In any
> case, the difference doesn't seem substantial.

I too noted the differences in enterElement and leaveElement but I believe
those difference are substantial, in my application anyway *smile*.

The HeaderImpl class is extended by the SetImpl class and deals with
the attributes; id, title and description. There is a 'state' variable
defined by AbstractUnmarshallingEventHandlerImpl. This state variable
governs the various switch statements in the callbacks enterAttribute,
leaveElement etc. It is here that the inconsistencies are manifested;

Consider the snippets below and in particular case 0. For the method
generated from schema a, "description" is delt with; whilst that
generated from c it is "id".

<curiosity> As to why SetImpl takes a special interest in "id" in one
instance
and "description" in the other I do not know (why not "title"?). Nor can
I work out what the "state" variable refers to does by reading the generated

code </curiosity>

Going back to my scenario and the zipped up attachment previously sent,
I have a generated class AExtendsSetTypeImpl in module A that extends
SetImpl. It expects the enterAttribute method (for example) to be as per
the first snippet below. But module C's version of SetImpl (the core
class definition referenced by other modules including A) was generated
from schema c separately and is slightly different as was seen when
comparing the first snippet to the second earlier.

I need to discard the SetImpl, HeaderImpl etc definitios generated from
schema a and use the definitions generated by Module C's schema c.
Module A of course depends on Module C.

Does that clarify? If so I'll edit this thread and add to bugzilla and
track it from there.

I would be great to get an indication of whether this 'bug' will be
important enough for the community to deal with it any time soon.

generated from schema a
-----------------------
line 178 SetImpl
        public void enterAttribute(java.lang.String ___uri, java.lang.String
___local, java.lang.String ___qname)
            throws org.xml.sax.SAXException
        {
            int attIdx;
            outer:
            while (true) {
                switch (state) {
                    case 0 :
                        if (("description" == ___local)&&("" == ___uri)) {
 
spawnHandlerFromEnterAttribute((((com.rr.c.impl.HeaderImpl)com.rr.c.impl.Set
Impl.this).new Unmarshaller(context)), 1, ___uri, ___local, ___qname);
                            return ;
                        }
                        break;
                    case 1 :
                        revertToParentFromEnterAttribute(___uri, ___local,
___qname);
                        return ;
                }
                super.enterAttribute(___uri, ___local, ___qname);
                break;
            }
        }

generated from schema c
-----------------------
line 178 SetImpl
        public void enterAttribute(java.lang.String ___uri, java.lang.String
___local, java.lang.String ___qname)
            throws org.xml.sax.SAXException
        {
            int attIdx;
            outer:
            while (true) {
                switch (state) {
                    case 1 :
                        revertToParentFromEnterAttribute(___uri, ___local,
___qname);
                        return ;
                    case 0 :
                        if (("id" == ___local)&&("" == ___uri)) {
 
spawnHandlerFromEnterAttribute((((com.rr.c.impl.HeaderImpl)com.rr.c.impl.Set
Impl.this).new Unmarshaller(context)), 1, ___uri, ___local, ___qname);
                            return ;
                        }
                        break;
                }
                super.enterAttribute(___uri, ___local, ___qname);
                break;
            }
        }


> I'd appreciate very much if you can also come with an instance that
> reproduces the problem.

Have I clarified the problem location or waffled on a little too much?

Best Regards

Ian



The data contained in, or attached to, this e-mail, may contain confidential
information. If you have received it in error you should notify the sender
immediately by reply e-mail, delete the message from your system and contact
+44(0)1332 242424 (the Rolls-Royce IT Security Director) if you need
assistance. Please do not copy it for any purpose, or disclose its contents
to any other person.

An e-mail response to this address may be subject to interception or
monitoring for operational reasons or for lawful business practices.

(c) 2003 Rolls-Royce plc

Registered office: 65 Buckingham Gate, London SW1E 6AT
Company number: 1003142. Registered in England.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe_at_jaxb.dev.java.net
For additional commands, e-mail: users-help_at_jaxb.dev.java.net