You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jaxme-dev@ws.apache.org by "Fredrik Vraalsen (JIRA)" <ja...@ws.apache.org> on 2005/07/14 10:25:10 UTC

[jira] Created: (JAXME-58) IDREF handling does not follow JAXB spec (5.8.2)/reference implementation

IDREF handling does not follow JAXB spec (5.8.2)/reference implementation
-------------------------------------------------------------------------

         Key: JAXME-58
         URL: http://issues.apache.org/jira/browse/JAXME-58
     Project: JaxMe
        Type: Bug
  Components: JaxMe Core  
    Versions: current (nightly)    
    Reporter: Fredrik Vraalsen


JaxMe's implementation of IDREF differs from the JAXB specification and the RI, as JaxMe seems to only set/get the IDREF String itself, as opposed to the RI which sets/gets the actual object being referenced.  From the JAXB spec (section 5.8.2):

"An element or attribute with a type of xs:IDREF refers to the element in the instance document that has an attribute with a type of xs:ID or derived from type xs:ID with the same value as the xs:IDREF value. Rather than expose the Java programmer to this XML Schema concept, the default binding of an xs:IDREF  component maps it to a Java property with a base type of java.lang.Object. The caller of the property setter method must be sure that its 
parameter is identifiable. An object is considered identifiable if one of its properties is derived from an attribute that is or derives from type xs:ID. There is an expectation that all instances provided as values for properties’ representing an xs:IDREF should have the Java property representing the xs:ID of the instances set before the content tree containing both the xs:ID and xs:IDREF is (1) globally validated or (2) marshalled. If a property representing an xs:IDREF is set with an object that does not have its xs:ID set, the NotIdentifiableEvent is reported by (1) validation or (2) marshalling."

See the spec for an example.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


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


Re: IDREF and xjc:dom

Posted by Jochen Wiedmann <jo...@gmail.com>.
Fredrik,

sorry for being bureacrazy, but please be so kind to attach the files to 
JAXME-58. This is also the best place for discussing the topic. Note, 
that all JIRA comments and attachments are automatically delegated to 
this mailing list.


Regards,

Jochen


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


Re: IDREF and xjc:dom

Posted by Fredrik Vraalsen <fr...@vraalsen.no>.
Fredrik Vraalsen wrote:

> I've also attached the schema I'm interested in compiling with JaxMe, in 
> case you are interested.

Doh!  That was not the right version of the schema... :-/  I can send 
you correct schemas later if you are interested.

Fredrik

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


Re: IDREF and xjc:dom

Posted by Fredrik Vraalsen <fr...@vraalsen.no>.
Jochen Wiedmann wrote:
> Hi, Fredrik,
> 
> both things shouldn't be technically too difficult. I'll start with
> the ID/IDREF thing, we may return to the xjc:dom implementation later.
> 
> Forgetting for a moment, that the actual bean classes need changes,
> I'll suggest that we start with validating the IDREF's. We'll later
> see, that this is actually most of the work, if we do it right.
> 
> If an object has embedded ID/IDREF's, then its generated SAX handler
> needs two additional objects:
> 
>   - A Map for storing the ID's and and the elements, to which are
> being mapped. An
>     element is added to this Map, whenever the SAX handler detects an
> ID. The Map
>     keys are the ID's and the Map elements are the associated elements.
>   - A List for storing the IDREF's. Whenever the SAX handler detects
> an IDREF, then
>     it adds an implementation of the interface
> 
>             interface IDREF {
>                 void validate(Map pIds) throws SAXException;
>             }
> 
>     The idea is, that the SAX handler will invoke all the IDREF's
> within endDocument().
>     Obviously, if the IDREF implementation is a suitable inner class,
> then it can not
>     only validate the reference, but invoke a proper setter as well.
> 
> For that first step, you should be able to work within the class
> DriverSGImpl and its subclasses only, so a deeper understanding of all
> the JaxMe details shouldn't be required.

Dear Jochen,

I started looking at this.  I've attached a first small patch to 
retrieve and store IDs from attributes in the SAX handler.  I haven't 
added checking for duplicate IDs yet.  However, to make this work 
properly (both duplicate checking and IDREF lookup), I think this map 
may need to be made global across all SAX handlers in some way? 
Otherwise, we will need to check the ID maps of all SAX handlers for 
duplicate IDs and when looking up an object via an IDREF.  The map of 
IDREFs, on the other hand, could be local to the SAX handler I think.

I don't know how to handle elements of type ID.  This isn't really 
relevant for my use at least, not even sure if it really makes sense. 
Anyway, if I have an element declared as

<xs:schema targetNamespace="http://www.clixml.org/clix/1.0"
[...]
     <xs:complexType>
       <xs:sequence>
         <xs:element name="id" type="xs:ID"/>
[...]

then the type ('childType' in GroupHandlerSG.handleEndElementState) of 
the element is the namespace URI ("http://www.clixml.org/clix/1.0") and 
local name ("id") of the element.  How do you retrieve the actual type 
of the element declared in the schema?

I've also attached the schema I'm interested in compiling with JaxMe, in 
case you are interested.


Best regards,

Fredrik Vraalsen
SINTEF

Re: IDREF and xjc:dom

Posted by Jochen Wiedmann <jo...@gmail.com>.
Hi, Fredrik,

both things shouldn't be technically too difficult. I'll start with
the ID/IDREF thing, we may return to the xjc:dom implementation later.

Forgetting for a moment, that the actual bean classes need changes,
I'll suggest that we start with validating the IDREF's. We'll later
see, that this is actually most of the work, if we do it right.

If an object has embedded ID/IDREF's, then its generated SAX handler
needs two additional objects:

  - A Map for storing the ID's and and the elements, to which are
being mapped. An
    element is added to this Map, whenever the SAX handler detects an
ID. The Map
    keys are the ID's and the Map elements are the associated elements.
  - A List for storing the IDREF's. Whenever the SAX handler detects
an IDREF, then
    it adds an implementation of the interface

            interface IDREF {
                void validate(Map pIds) throws SAXException;
            }

    The idea is, that the SAX handler will invoke all the IDREF's
within endDocument().
    Obviously, if the IDREF implementation is a suitable inner class,
then it can not
    only validate the reference, but invoke a proper setter as well.

For that first step, you should be able to work within the class
DriverSGImpl and its subclasses only, so a deeper understanding of all
the JaxMe details shouldn't be required.


In any case, regards for the hint, that we do not meet the SPEC's in
that particular point.


Jochen


-- 
What are the first steps on the moon, compared to your child's?

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


IDREF and xjc:dom

Posted by Fredrik Vraalsen <fr...@vraalsen.no>.
Hi,

First of all, I've been using JaxMe for a while, thanks for all the
great work! :)  However, recently I've gotten some new requirements
which have forced me to move to the JAXB Reference Implementation.

Firstly, my project needs support for the xjc:dom extension to import
arbitrary XML as a DOM tree.  Is there any ongoing work to support this
in JaxMe?

Secondly, I use IDREF to handle references between various objects which
are not structured in a strictly hierarchical fashion.  JaxMe's
implementation of IDREF differs from the JAXB specification and the RI,
as JaxMe only sets/gets the IDREF String itself, as opposed to the RI
which sets/gets the actual object being referenced.  See the spec
(section 5.8.2) for more info.  I've also opened a new JIRA issue
(http://issues.apache.org/jira/browse/JAXME-58).

If you could point me to the appropriate files I could also have a look
at this myself.


Best regards,

Fredrik Vraalsen
SINTEF - http://www.sintef.no/


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


[jira] Updated: (JAXME-58) IDREF handling does not follow JAXB spec (5.8.2)/reference implementation

Posted by "Fredrik Vraalsen (JIRA)" <ja...@ws.apache.org>.
     [ http://issues.apache.org/jira/browse/JAXME-58?page=all ]

Fredrik Vraalsen updated JAXME-58:
----------------------------------

    Attachment: idMap.patch

patch to record XML IDs in global idMap

> IDREF handling does not follow JAXB spec (5.8.2)/reference implementation
> -------------------------------------------------------------------------
>
>          Key: JAXME-58
>          URL: http://issues.apache.org/jira/browse/JAXME-58
>      Project: JaxMe
>         Type: Bug
>   Components: JaxMe Core
>     Versions: current (nightly)
>     Reporter: Fredrik Vraalsen
>  Attachments: idMap.patch
>
> JaxMe's implementation of IDREF differs from the JAXB specification and the RI, as JaxMe seems to only set/get the IDREF String itself, as opposed to the RI which sets/gets the actual object being referenced.  From the JAXB spec (section 5.8.2):
> "An element or attribute with a type of xs:IDREF refers to the element in the instance document that has an attribute with a type of xs:ID or derived from type xs:ID with the same value as the xs:IDREF value. Rather than expose the Java programmer to this XML Schema concept, the default binding of an xs:IDREF  component maps it to a Java property with a base type of java.lang.Object. The caller of the property setter method must be sure that its 
> parameter is identifiable. An object is considered identifiable if one of its properties is derived from an attribute that is or derives from type xs:ID. There is an expectation that all instances provided as values for properties? representing an xs:IDREF should have the Java property representing the xs:ID of the instances set before the content tree containing both the xs:ID and xs:IDREF is (1) globally validated or (2) marshalled. If a property representing an xs:IDREF is set with an object that does not have its xs:ID set, the NotIdentifiableEvent is reported by (1) validation or (2) marshalling."
> See the spec for an example.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


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


[jira] Aktualisiert: (JAXME-58) IDREF handling does not follow JAXB spec (5.8.2)/reference implementation

Posted by "Jochen Wiedmann (JIRA)" <ja...@ws.apache.org>.
     [ http://issues.apache.org/jira/browse/JAXME-58?page=all ]

Jochen Wiedmann updated JAXME-58:
---------------------------------

    Attachment: idMap3.patch

To keep the discussion open, a modified version of your patch. The IDREF properties should now be objects indeed.

I am currently considering, how to resolve an objects ID while marshalling.

> IDREF handling does not follow JAXB spec (5.8.2)/reference implementation
> -------------------------------------------------------------------------
>
>          Key: JAXME-58
>          URL: http://issues.apache.org/jira/browse/JAXME-58
>      Project: JaxMe
>         Type: Bug
>   Components: JaxMe Core
>     Versions: current (nightly)
>     Reporter: Fredrik Vraalsen
>  Attachments: idMap.patch, idMap.patch, idMap3.patch
>
> JaxMe's implementation of IDREF differs from the JAXB specification and the RI, as JaxMe seems to only set/get the IDREF String itself, as opposed to the RI which sets/gets the actual object being referenced.  From the JAXB spec (section 5.8.2):
> "An element or attribute with a type of xs:IDREF refers to the element in the instance document that has an attribute with a type of xs:ID or derived from type xs:ID with the same value as the xs:IDREF value. Rather than expose the Java programmer to this XML Schema concept, the default binding of an xs:IDREF  component maps it to a Java property with a base type of java.lang.Object. The caller of the property setter method must be sure that its 
> parameter is identifiable. An object is considered identifiable if one of its properties is derived from an attribute that is or derives from type xs:ID. There is an expectation that all instances provided as values for properties? representing an xs:IDREF should have the Java property representing the xs:ID of the instances set before the content tree containing both the xs:ID and xs:IDREF is (1) globally validated or (2) marshalled. If a property representing an xs:IDREF is set with an object that does not have its xs:ID set, the NotIdentifiableEvent is reported by (1) validation or (2) marshalling."
> See the spec for an example.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


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


[jira] Kommentiert: (JAXME-58) IDREF handling does not follow JAXB spec (5.8.2)/reference implementation

Posted by "Jochen Wiedmann (JIRA)" <ja...@ws.apache.org>.
    [ http://issues.apache.org/jira/browse/JAXME-58?page=comments#action_12315892 ] 

Jochen Wiedmann commented on JAXME-58:
--------------------------------------

Proposed way to resolve the issue;

Forgetting for a moment, that the actual bean classes need changes,
I'll suggest that we start with validating the IDREF's. We'll later
see, that this is actually most of the work, if we do it right.

If an object has embedded ID/IDREF's, then its generated SAX handler
needs two additional objects:

  - A Map for storing the ID's and and the elements, to which are
being mapped. An
    element is added to this Map, whenever the SAX handler detects an
ID. The Map
    keys are the ID's and the Map elements are the associated elements.
  - A List for storing the IDREF's. Whenever the SAX handler detects
an IDREF, then
    it adds an implementation of the interface

            interface IDREF {
                void validate(Map pIds) throws SAXException;
            }

    The idea is, that the SAX handler will invoke all the IDREF's
within endDocument().
    Obviously, if the IDREF implementation is a suitable inner class,
then it can not
    only validate the reference, but invoke a proper setter as well.

For that first step, you should be able to work within the class
DriverSGImpl and its subclasses only, so a deeper understanding of all
the JaxMe details shouldn't be required.


> IDREF handling does not follow JAXB spec (5.8.2)/reference implementation
> -------------------------------------------------------------------------
>
>          Key: JAXME-58
>          URL: http://issues.apache.org/jira/browse/JAXME-58
>      Project: JaxMe
>         Type: Bug
>   Components: JaxMe Core
>     Versions: current (nightly)
>     Reporter: Fredrik Vraalsen

>
> JaxMe's implementation of IDREF differs from the JAXB specification and the RI, as JaxMe seems to only set/get the IDREF String itself, as opposed to the RI which sets/gets the actual object being referenced.  From the JAXB spec (section 5.8.2):
> "An element or attribute with a type of xs:IDREF refers to the element in the instance document that has an attribute with a type of xs:ID or derived from type xs:ID with the same value as the xs:IDREF value. Rather than expose the Java programmer to this XML Schema concept, the default binding of an xs:IDREF  component maps it to a Java property with a base type of java.lang.Object. The caller of the property setter method must be sure that its 
> parameter is identifiable. An object is considered identifiable if one of its properties is derived from an attribute that is or derives from type xs:ID. There is an expectation that all instances provided as values for properties? representing an xs:IDREF should have the Java property representing the xs:ID of the instances set before the content tree containing both the xs:ID and xs:IDREF is (1) globally validated or (2) marshalled. If a property representing an xs:IDREF is set with an object that does not have its xs:ID set, the NotIdentifiableEvent is reported by (1) validation or (2) marshalling."
> See the spec for an example.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


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


[jira] Updated: (JAXME-58) IDREF handling does not follow JAXB spec (5.8.2)/reference implementation

Posted by "Fredrik Vraalsen (JIRA)" <ja...@ws.apache.org>.
     [ http://issues.apache.org/jira/browse/JAXME-58?page=all ]

Fredrik Vraalsen updated JAXME-58:
----------------------------------

    Attachment: idMap5.patch
                booklist.xsd
                booklist.xml

New attempt at ID/IDREF implementation.  Added a new 'ID' interface to be implemented by the Impl classes of beans with id attributes.  The 'getIdAttribute' method thus just needs to check whether the object implements the ID interface and if so call the 'xmlGetId' method.  This approach works on the attached test files.

> IDREF handling does not follow JAXB spec (5.8.2)/reference implementation
> -------------------------------------------------------------------------
>
>          Key: JAXME-58
>          URL: http://issues.apache.org/jira/browse/JAXME-58
>      Project: JaxMe
>         Type: Bug
>   Components: JaxMe Core
>     Versions: current (nightly)
>     Reporter: Fredrik Vraalsen
>  Attachments: booklist.xml, booklist.xsd, idMap.patch, idMap.patch, idMap3.patch, idMap4.patch, idMap5.patch
>
> JaxMe's implementation of IDREF differs from the JAXB specification and the RI, as JaxMe seems to only set/get the IDREF String itself, as opposed to the RI which sets/gets the actual object being referenced.  From the JAXB spec (section 5.8.2):
> "An element or attribute with a type of xs:IDREF refers to the element in the instance document that has an attribute with a type of xs:ID or derived from type xs:ID with the same value as the xs:IDREF value. Rather than expose the Java programmer to this XML Schema concept, the default binding of an xs:IDREF  component maps it to a Java property with a base type of java.lang.Object. The caller of the property setter method must be sure that its 
> parameter is identifiable. An object is considered identifiable if one of its properties is derived from an attribute that is or derives from type xs:ID. There is an expectation that all instances provided as values for properties? representing an xs:IDREF should have the Java property representing the xs:ID of the instances set before the content tree containing both the xs:ID and xs:IDREF is (1) globally validated or (2) marshalled. If a property representing an xs:IDREF is set with an object that does not have its xs:ID set, the NotIdentifiableEvent is reported by (1) validation or (2) marshalling."
> See the spec for an example.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


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


[jira] Commented: (JAXME-58) IDREF handling does not follow JAXB spec (5.8.2)/reference implementation

Posted by "Fredrik Vraalsen (JIRA)" <ja...@ws.apache.org>.
    [ http://issues.apache.org/jira/browse/JAXME-58?page=comments#action_12317941 ] 

Fredrik Vraalsen commented on JAXME-58:
---------------------------------------

I see now I misunderstood how you were planning on using the getIdAttribute method. Please ignore my previous patch ;-)

> IDREF handling does not follow JAXB spec (5.8.2)/reference implementation
> -------------------------------------------------------------------------
>
>          Key: JAXME-58
>          URL: http://issues.apache.org/jira/browse/JAXME-58
>      Project: JaxMe
>         Type: Bug
>   Components: JaxMe Core
>     Versions: current (nightly)
>     Reporter: Fredrik Vraalsen
>  Attachments: idMap.patch, idMap.patch, idMap3.patch, idMap4.patch
>
> JaxMe's implementation of IDREF differs from the JAXB specification and the RI, as JaxMe seems to only set/get the IDREF String itself, as opposed to the RI which sets/gets the actual object being referenced.  From the JAXB spec (section 5.8.2):
> "An element or attribute with a type of xs:IDREF refers to the element in the instance document that has an attribute with a type of xs:ID or derived from type xs:ID with the same value as the xs:IDREF value. Rather than expose the Java programmer to this XML Schema concept, the default binding of an xs:IDREF  component maps it to a Java property with a base type of java.lang.Object. The caller of the property setter method must be sure that its 
> parameter is identifiable. An object is considered identifiable if one of its properties is derived from an attribute that is or derives from type xs:ID. There is an expectation that all instances provided as values for properties? representing an xs:IDREF should have the Java property representing the xs:ID of the instances set before the content tree containing both the xs:ID and xs:IDREF is (1) globally validated or (2) marshalled. If a property representing an xs:IDREF is set with an object that does not have its xs:ID set, the NotIdentifiableEvent is reported by (1) validation or (2) marshalling."
> See the spec for an example.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


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


[jira] Updated: (JAXME-58) IDREF handling does not follow JAXB spec (5.8.2)/reference implementation

Posted by "Fredrik Vraalsen (JIRA)" <ja...@ws.apache.org>.
     [ http://issues.apache.org/jira/browse/JAXME-58?page=all ]

Fredrik Vraalsen updated JAXME-58:
----------------------------------

    Attachment: idMap4.patch

Added generation of 'getIdAttribute' method to DriverGeneratingVisitor + fixed HandlerSGImpl (typeName and idref local fields)

> IDREF handling does not follow JAXB spec (5.8.2)/reference implementation
> -------------------------------------------------------------------------
>
>          Key: JAXME-58
>          URL: http://issues.apache.org/jira/browse/JAXME-58
>      Project: JaxMe
>         Type: Bug
>   Components: JaxMe Core
>     Versions: current (nightly)
>     Reporter: Fredrik Vraalsen
>  Attachments: idMap.patch, idMap.patch, idMap3.patch, idMap4.patch
>
> JaxMe's implementation of IDREF differs from the JAXB specification and the RI, as JaxMe seems to only set/get the IDREF String itself, as opposed to the RI which sets/gets the actual object being referenced.  From the JAXB spec (section 5.8.2):
> "An element or attribute with a type of xs:IDREF refers to the element in the instance document that has an attribute with a type of xs:ID or derived from type xs:ID with the same value as the xs:IDREF value. Rather than expose the Java programmer to this XML Schema concept, the default binding of an xs:IDREF  component maps it to a Java property with a base type of java.lang.Object. The caller of the property setter method must be sure that its 
> parameter is identifiable. An object is considered identifiable if one of its properties is derived from an attribute that is or derives from type xs:ID. There is an expectation that all instances provided as values for properties? representing an xs:IDREF should have the Java property representing the xs:ID of the instances set before the content tree containing both the xs:ID and xs:IDREF is (1) globally validated or (2) marshalled. If a property representing an xs:IDREF is set with an object that does not have its xs:ID set, the NotIdentifiableEvent is reported by (1) validation or (2) marshalling."
> See the spec for an example.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


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


[jira] Aktualisiert: (JAXME-58) IDREF handling does not follow JAXB spec (5.8.2)/reference implementation

Posted by "Jochen Wiedmann (JIRA)" <ja...@ws.apache.org>.
     [ http://issues.apache.org/jira/browse/JAXME-58?page=all ]

Jochen Wiedmann updated JAXME-58:
---------------------------------

    Attachment: JAXME-58.patch

The attached patch could be considered the final implementation. I've changed the following things:

- The ID interface is no longer used. Use of an interface would definitely be
  the technically superior solution. However, it would prevent using POJO's
  in the future.
- Duplicate ID's and invalid IDREF's are causing proper validation events.
- The files booklist.xsd and booklist.xml have been converted into a unit test.

I do not yet apply this patch: It is a larger patch and I want to merge the JAXME-28,
branch into the trunk before, because I would have a lot of duplicate work otherwise.
Hope to merge JAXME-28 within the next one or two weeks, at which point I'd apply
this patch.

Creating this patch has been an excellent team effort for me. I am open for a new bug
report concerning xjc:dom now, if you are ready to continue. :-)


> IDREF handling does not follow JAXB spec (5.8.2)/reference implementation
> -------------------------------------------------------------------------
>
>          Key: JAXME-58
>          URL: http://issues.apache.org/jira/browse/JAXME-58
>      Project: JaxMe
>         Type: Bug
>   Components: JaxMe Core
>     Versions: current (nightly)
>     Reporter: Fredrik Vraalsen
>  Attachments: JAXME-58.patch, booklist.xml, booklist.xsd, idMap.patch, idMap.patch, idMap3.patch, idMap4.patch, idMap5.patch
>
> JaxMe's implementation of IDREF differs from the JAXB specification and the RI, as JaxMe seems to only set/get the IDREF String itself, as opposed to the RI which sets/gets the actual object being referenced.  From the JAXB spec (section 5.8.2):
> "An element or attribute with a type of xs:IDREF refers to the element in the instance document that has an attribute with a type of xs:ID or derived from type xs:ID with the same value as the xs:IDREF value. Rather than expose the Java programmer to this XML Schema concept, the default binding of an xs:IDREF  component maps it to a Java property with a base type of java.lang.Object. The caller of the property setter method must be sure that its 
> parameter is identifiable. An object is considered identifiable if one of its properties is derived from an attribute that is or derives from type xs:ID. There is an expectation that all instances provided as values for properties? representing an xs:IDREF should have the Java property representing the xs:ID of the instances set before the content tree containing both the xs:ID and xs:IDREF is (1) globally validated or (2) marshalled. If a property representing an xs:IDREF is set with an object that does not have its xs:ID set, the NotIdentifiableEvent is reported by (1) validation or (2) marshalling."
> See the spec for an example.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


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


[jira] Updated: (JAXME-58) IDREF handling does not follow JAXB spec (5.8.2)/reference implementation

Posted by "Anonymous (JIRA)" <ja...@ws.apache.org>.
     [ http://issues.apache.org/jira/browse/JAXME-58?page=all ]

 updated JAXME-58:
------------------

    Attachment: idMap.patch

> IDREF handling does not follow JAXB spec (5.8.2)/reference implementation
> -------------------------------------------------------------------------
>
>          Key: JAXME-58
>          URL: http://issues.apache.org/jira/browse/JAXME-58
>      Project: JaxMe
>         Type: Bug
>   Components: JaxMe Core
>     Versions: current (nightly)
>     Reporter: Fredrik Vraalsen
>  Attachments: idMap.patch, idMap.patch
>
> JaxMe's implementation of IDREF differs from the JAXB specification and the RI, as JaxMe seems to only set/get the IDREF String itself, as opposed to the RI which sets/gets the actual object being referenced.  From the JAXB spec (section 5.8.2):
> "An element or attribute with a type of xs:IDREF refers to the element in the instance document that has an attribute with a type of xs:ID or derived from type xs:ID with the same value as the xs:IDREF value. Rather than expose the Java programmer to this XML Schema concept, the default binding of an xs:IDREF  component maps it to a Java property with a base type of java.lang.Object. The caller of the property setter method must be sure that its 
> parameter is identifiable. An object is considered identifiable if one of its properties is derived from an attribute that is or derives from type xs:ID. There is an expectation that all instances provided as values for properties? representing an xs:IDREF should have the Java property representing the xs:ID of the instances set before the content tree containing both the xs:ID and xs:IDREF is (1) globally validated or (2) marshalled. If a property representing an xs:IDREF is set with an object that does not have its xs:ID set, the NotIdentifiableEvent is reported by (1) validation or (2) marshalling."
> See the spec for an example.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


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


[jira] Kommentiert: (JAXME-58) IDREF handling does not follow JAXB spec (5.8.2)/reference implementation

Posted by "Jochen Wiedmann (JIRA)" <ja...@ws.apache.org>.
    [ http://issues.apache.org/jira/browse/JAXME-58?page=comments#action_12315891 ] 

Jochen Wiedmann commented on JAXME-58:
--------------------------------------

A question which came up while discussing the feature: To resolve IDREF's, the parser will obviously create an internal Map of ID => IDREF's. Does the JAXB RI allow access to that Map somehow?


> IDREF handling does not follow JAXB spec (5.8.2)/reference implementation
> -------------------------------------------------------------------------
>
>          Key: JAXME-58
>          URL: http://issues.apache.org/jira/browse/JAXME-58
>      Project: JaxMe
>         Type: Bug
>   Components: JaxMe Core
>     Versions: current (nightly)
>     Reporter: Fredrik Vraalsen

>
> JaxMe's implementation of IDREF differs from the JAXB specification and the RI, as JaxMe seems to only set/get the IDREF String itself, as opposed to the RI which sets/gets the actual object being referenced.  From the JAXB spec (section 5.8.2):
> "An element or attribute with a type of xs:IDREF refers to the element in the instance document that has an attribute with a type of xs:ID or derived from type xs:ID with the same value as the xs:IDREF value. Rather than expose the Java programmer to this XML Schema concept, the default binding of an xs:IDREF  component maps it to a Java property with a base type of java.lang.Object. The caller of the property setter method must be sure that its 
> parameter is identifiable. An object is considered identifiable if one of its properties is derived from an attribute that is or derives from type xs:ID. There is an expectation that all instances provided as values for properties? representing an xs:IDREF should have the Java property representing the xs:ID of the instances set before the content tree containing both the xs:ID and xs:IDREF is (1) globally validated or (2) marshalled. If a property representing an xs:IDREF is set with an object that does not have its xs:ID set, the NotIdentifiableEvent is reported by (1) validation or (2) marshalling."
> See the spec for an example.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


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


[jira] Commented: (JAXME-58) IDREF handling does not follow JAXB spec (5.8.2)/reference implementation

Posted by "Fredrik Vraalsen (JIRA)" <ja...@ws.apache.org>.
    [ http://issues.apache.org/jira/browse/JAXME-58?page=comments#action_12317769 ] 

Fredrik Vraalsen commented on JAXME-58:
---------------------------------------

Updated idMap patch with support for IDREFs.

The setter and getter methods of IDREF attributes need to be updated to accept/return Objects - or possibly some other interface which provides access to the ID of the object being referenced (needed e.g. when serializing to XML)?  Check JAXB spec.  This requires changes to IDREFSG at least, but I'm not familiar enough with the JaxMe code to make this work.


> IDREF handling does not follow JAXB spec (5.8.2)/reference implementation
> -------------------------------------------------------------------------
>
>          Key: JAXME-58
>          URL: http://issues.apache.org/jira/browse/JAXME-58
>      Project: JaxMe
>         Type: Bug
>   Components: JaxMe Core
>     Versions: current (nightly)
>     Reporter: Fredrik Vraalsen
>  Attachments: idMap.patch, idMap.patch
>
> JaxMe's implementation of IDREF differs from the JAXB specification and the RI, as JaxMe seems to only set/get the IDREF String itself, as opposed to the RI which sets/gets the actual object being referenced.  From the JAXB spec (section 5.8.2):
> "An element or attribute with a type of xs:IDREF refers to the element in the instance document that has an attribute with a type of xs:ID or derived from type xs:ID with the same value as the xs:IDREF value. Rather than expose the Java programmer to this XML Schema concept, the default binding of an xs:IDREF  component maps it to a Java property with a base type of java.lang.Object. The caller of the property setter method must be sure that its 
> parameter is identifiable. An object is considered identifiable if one of its properties is derived from an attribute that is or derives from type xs:ID. There is an expectation that all instances provided as values for properties? representing an xs:IDREF should have the Java property representing the xs:ID of the instances set before the content tree containing both the xs:ID and xs:IDREF is (1) globally validated or (2) marshalled. If a property representing an xs:IDREF is set with an object that does not have its xs:ID set, the NotIdentifiableEvent is reported by (1) validation or (2) marshalling."
> See the spec for an example.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


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


[jira] Geschlossen: (JAXME-58) IDREF handling does not follow JAXB spec (5.8.2)/reference implementation

Posted by "Jochen Wiedmann (JIRA)" <ja...@ws.apache.org>.
     [ http://issues.apache.org/jira/browse/JAXME-58?page=all ]
     
Jochen Wiedmann closed JAXME-58:
--------------------------------

    Fix Version: 0.6
     Resolution: Fixed
      Assign To: Jochen Wiedmann

After initial work on merging the JAXME-28 branch, I changed my mind and decided to commit this patch first to thr trunk.


> IDREF handling does not follow JAXB spec (5.8.2)/reference implementation
> -------------------------------------------------------------------------
>
>          Key: JAXME-58
>          URL: http://issues.apache.org/jira/browse/JAXME-58
>      Project: JaxMe
>         Type: Bug
>   Components: JaxMe Core
>     Versions: current (nightly)
>     Reporter: Fredrik Vraalsen
>     Assignee: Jochen Wiedmann
>      Fix For: 0.6
>  Attachments: JAXME-58.patch, booklist.xml, booklist.xsd, idMap.patch, idMap.patch, idMap3.patch, idMap4.patch, idMap5.patch
>
> JaxMe's implementation of IDREF differs from the JAXB specification and the RI, as JaxMe seems to only set/get the IDREF String itself, as opposed to the RI which sets/gets the actual object being referenced.  From the JAXB spec (section 5.8.2):
> "An element or attribute with a type of xs:IDREF refers to the element in the instance document that has an attribute with a type of xs:ID or derived from type xs:ID with the same value as the xs:IDREF value. Rather than expose the Java programmer to this XML Schema concept, the default binding of an xs:IDREF  component maps it to a Java property with a base type of java.lang.Object. The caller of the property setter method must be sure that its 
> parameter is identifiable. An object is considered identifiable if one of its properties is derived from an attribute that is or derives from type xs:ID. There is an expectation that all instances provided as values for properties? representing an xs:IDREF should have the Java property representing the xs:ID of the instances set before the content tree containing both the xs:ID and xs:IDREF is (1) globally validated or (2) marshalled. If a property representing an xs:IDREF is set with an object that does not have its xs:ID set, the NotIdentifiableEvent is reported by (1) validation or (2) marshalling."
> See the spec for an example.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


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