Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mapping XML schema for containment vs reference #22

Open
Tomas-Kraus opened this issue Apr 19, 2004 · 6 comments
Open

mapping XML schema for containment vs reference #22

Tomas-Kraus opened this issue Apr 19, 2004 · 6 comments
Assignees
Labels
enhancement New feature or request javatoxsd component Major Priority
Milestone

Comments

@Tomas-Kraus
Copy link
Contributor

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]

@Tomas-Kraus
Copy link
Contributor Author

@glassfishrobot Commented
Reported by sekhar

@Tomas-Kraus
Copy link
Contributor Author

@glassfishrobot Commented
Was assigned to sekhar

@Tomas-Kraus
Copy link
Contributor Author

@glassfishrobot Commented
sekhar said:
Changed Issue type from "DEFECT" to "FEATURE"

@Tomas-Kraus
Copy link
Contributor Author

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

@Tomas-Kraus
Copy link
Contributor Author

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

@Tomas-Kraus
Copy link
Contributor Author

@Tomas-Kraus Tomas-Kraus added this to the milestone 1 milestone Sep 13, 2018
@lukasj lukasj added enhancement New feature or request and removed ERR: Assignee labels May 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request javatoxsd component Major Priority
Projects
None yet
Development

No branches or pull requests

3 participants