Skip to content
This repository has been archived by the owner on Sep 24, 2018. It is now read-only.

mapping XML schema for containment vs reference #22

Open
glassfishrobot opened this issue Apr 19, 2004 · 5 comments
Open

mapping XML schema for containment vs reference #22

glassfishrobot opened this issue Apr 19, 2004 · 5 comments

Comments

@glassfishrobot
Copy link

Issue 22: mapping : Containment vs. reference

The following two approaches have been discussed in the expert group
prior to the F2F.

1. JAXB 2.0 provides mechanisms which can be used to customize the
generated XML schema to allow a reference to an object to be
marshalled by containment or by reference.This approach has
issues - not user friendly (e.g. can result in for cycles), hard
to use etc. Nonetheless, this option does provide control to a
user for customizing the generated schema and was thought
worthwhile to explore this option further.

The discussion threads are here:

http://archives.java.sun.com/cgi-bin/wa?A2=ind0402&L=jsr-222-eg&X=12E27C5E49150B4D5C&[email protected]&P=3204

http://archives.java.sun.com/cgi-bin/wa?A2=ind0403&L=jsr-222-eg&X=12E27C5E49150B4D5C&[email protected]&P=728

2. JAXB 2.0 determines based on the object graph the marshalling of
an object by containment or reference. For example, the first time
an object is marshalled, it is marshalled by
containment. Subsequent references of object are marshalled by
reference. This would be enabled by generating an XML schema with
a xs:choice that includes both an id or a reference to an id
(defined elsewhere). See the thread

http://archives.java.sun.com/cgi-bin/wa?A2=ind0402&L=jsr-222-eg&X=12E27C5E49150B4D5C&[email protected]&P=3204

Additionally the following approach was suggested at the JAXB 2.0 F2F.

3. A third approach was suggested in JAXB 2.0 F2F by Steve
Brodsky. The discussion is in bullet 13 in the F2F minutes:

https://www.dev.java.net/files/documents/919/3776/f2f-minutes.txt

The summary of this approach is: XML instance could just list
every single object at the top-level and all the references can be
ID/IDREF (since Java does not distinguish between containment
vs. reference). The generated XML schema might not be useful or
meaningful in some cases. In such a case, Java classes have to be
customized to produce the desired XML schema i.e. use approach 1
noted in bullet item 1 above.

Environment

Operating System: All
Platform: All

Affected Versions

[2.0 draft]

@glassfishrobot
Copy link
Author

Reported by sekhar

@glassfishrobot
Copy link
Author

Was assigned to sekhar

@glassfishrobot
Copy link
Author

sekhar said:
Changed Issue type from "DEFECT" to "FEATURE"

@glassfishrobot
Copy link
Author

sekhar said:
Updating the status to follow the lifecycle issue outlined in the
jaxb20-note-0007.txt.

@glassfishrobot
Copy link
Author

This issue was imported from java.net JIRA JSR222-22

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant