How to improve XML schema with sub-elements or references?
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ height:90px;width:728px;box-sizing:border-box;
}
I have a xml schema like the one being shown below but I have noticed that it would be very complicated to maintain.
I want to improve the current schema in one of the following ways but I am not sure if they would be the best/correct route:
Option 1: Use a reference of all elements of movieDetails
within movies
.
Option 2: Add movieDetails
as a sub-element of movies
(which I frankly am struggling to achieve)
Which route would be best and what would be the best way to structure it?
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://xml.netbeans.org/schema/AmazingMovies"
xmlns:tns="http://xml.netbeans.org/schema/AmazingMovies"
elementFormDefault="qualified">
<xsd:complexType name="movies">
<xsd:sequence>
<xsd:element name="Title" type="xsd:string"/>
<xsd:element name="Director" type="xsd:string"></xsd:element>
<xsd:element name="Year" type="xsd:int"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="movieDetails">
<xsd:sequence>
<xsd:element name="Actor" type="xsd:string"/>
<xsd:element name="numberOfCast" type="xsd:int"></xsd:element>
<xsd:element name="releaseDate" type="xsd:date"/>
</xsd:sequence>
</xsd:complexType>
<xsd:element name="OnDisplay">
<xsd:complexType>
<xsd:sequence >
<xsd:element name="collectionOfMovies" type="tns:movies" minOccurs="0" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>
Extra information
OnDisplay
element would add all elements ofmovies
into a list in order to use them when unMarshalling. However, I want to also addmovieDetails
ontoOnDisplay
, therefore, it would be convenient to have them included inmovies
as a ref, sub-element or another form.
Tried the following methods but failed XML validation
Method 1
<xsd:element name="MoviesAndDetails">
<xsd:complexType name="movies">
<xsd:sequence>
<xsd:element name="Title" type="xsd:string"/>
<xsd:element name="Director" type="xsd:string"></xsd:element>
<xsd:element name="Year" type="xsd:int"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="movieDetails">
<xsd:sequence>
<xsd:element name="Actor" type="xsd:string"/>
<xsd:element name="numberOfCast" type="xsd:int"> </xsd:element>
<xsd:element name="releaseDate" type="xsd:date"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
Method 2
<xsd:complexType name="MoviesAndDetails">
<xsd:complexType name="movies">
<xsd:sequence>
<xsd:element name="Title" type="xsd:string"/>
<xsd:element name="Director" type="xsd:string"></xsd:element>
<xsd:element name="Year" type="xsd:int"/>
<xsd:element ref="Actor"/>
<xsd:element ref="numberOfCast"/>
<xsd:element ref="releaseDate"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="movieDetails">
<xsd:sequence>
<xsd:element name="Actor" type="xsd:string"/>
<xsd:element name="numberOfCast" type="xsd:int"> </xsd:element>
<xsd:element name="releaseDate" type="xsd:date"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
xml xsd xml-schema-collection
add a comment |
I have a xml schema like the one being shown below but I have noticed that it would be very complicated to maintain.
I want to improve the current schema in one of the following ways but I am not sure if they would be the best/correct route:
Option 1: Use a reference of all elements of movieDetails
within movies
.
Option 2: Add movieDetails
as a sub-element of movies
(which I frankly am struggling to achieve)
Which route would be best and what would be the best way to structure it?
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://xml.netbeans.org/schema/AmazingMovies"
xmlns:tns="http://xml.netbeans.org/schema/AmazingMovies"
elementFormDefault="qualified">
<xsd:complexType name="movies">
<xsd:sequence>
<xsd:element name="Title" type="xsd:string"/>
<xsd:element name="Director" type="xsd:string"></xsd:element>
<xsd:element name="Year" type="xsd:int"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="movieDetails">
<xsd:sequence>
<xsd:element name="Actor" type="xsd:string"/>
<xsd:element name="numberOfCast" type="xsd:int"></xsd:element>
<xsd:element name="releaseDate" type="xsd:date"/>
</xsd:sequence>
</xsd:complexType>
<xsd:element name="OnDisplay">
<xsd:complexType>
<xsd:sequence >
<xsd:element name="collectionOfMovies" type="tns:movies" minOccurs="0" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>
Extra information
OnDisplay
element would add all elements ofmovies
into a list in order to use them when unMarshalling. However, I want to also addmovieDetails
ontoOnDisplay
, therefore, it would be convenient to have them included inmovies
as a ref, sub-element or another form.
Tried the following methods but failed XML validation
Method 1
<xsd:element name="MoviesAndDetails">
<xsd:complexType name="movies">
<xsd:sequence>
<xsd:element name="Title" type="xsd:string"/>
<xsd:element name="Director" type="xsd:string"></xsd:element>
<xsd:element name="Year" type="xsd:int"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="movieDetails">
<xsd:sequence>
<xsd:element name="Actor" type="xsd:string"/>
<xsd:element name="numberOfCast" type="xsd:int"> </xsd:element>
<xsd:element name="releaseDate" type="xsd:date"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
Method 2
<xsd:complexType name="MoviesAndDetails">
<xsd:complexType name="movies">
<xsd:sequence>
<xsd:element name="Title" type="xsd:string"/>
<xsd:element name="Director" type="xsd:string"></xsd:element>
<xsd:element name="Year" type="xsd:int"/>
<xsd:element ref="Actor"/>
<xsd:element ref="numberOfCast"/>
<xsd:element ref="releaseDate"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="movieDetails">
<xsd:sequence>
<xsd:element name="Actor" type="xsd:string"/>
<xsd:element name="numberOfCast" type="xsd:int"> </xsd:element>
<xsd:element name="releaseDate" type="xsd:date"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
xml xsd xml-schema-collection
add a comment |
I have a xml schema like the one being shown below but I have noticed that it would be very complicated to maintain.
I want to improve the current schema in one of the following ways but I am not sure if they would be the best/correct route:
Option 1: Use a reference of all elements of movieDetails
within movies
.
Option 2: Add movieDetails
as a sub-element of movies
(which I frankly am struggling to achieve)
Which route would be best and what would be the best way to structure it?
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://xml.netbeans.org/schema/AmazingMovies"
xmlns:tns="http://xml.netbeans.org/schema/AmazingMovies"
elementFormDefault="qualified">
<xsd:complexType name="movies">
<xsd:sequence>
<xsd:element name="Title" type="xsd:string"/>
<xsd:element name="Director" type="xsd:string"></xsd:element>
<xsd:element name="Year" type="xsd:int"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="movieDetails">
<xsd:sequence>
<xsd:element name="Actor" type="xsd:string"/>
<xsd:element name="numberOfCast" type="xsd:int"></xsd:element>
<xsd:element name="releaseDate" type="xsd:date"/>
</xsd:sequence>
</xsd:complexType>
<xsd:element name="OnDisplay">
<xsd:complexType>
<xsd:sequence >
<xsd:element name="collectionOfMovies" type="tns:movies" minOccurs="0" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>
Extra information
OnDisplay
element would add all elements ofmovies
into a list in order to use them when unMarshalling. However, I want to also addmovieDetails
ontoOnDisplay
, therefore, it would be convenient to have them included inmovies
as a ref, sub-element or another form.
Tried the following methods but failed XML validation
Method 1
<xsd:element name="MoviesAndDetails">
<xsd:complexType name="movies">
<xsd:sequence>
<xsd:element name="Title" type="xsd:string"/>
<xsd:element name="Director" type="xsd:string"></xsd:element>
<xsd:element name="Year" type="xsd:int"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="movieDetails">
<xsd:sequence>
<xsd:element name="Actor" type="xsd:string"/>
<xsd:element name="numberOfCast" type="xsd:int"> </xsd:element>
<xsd:element name="releaseDate" type="xsd:date"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
Method 2
<xsd:complexType name="MoviesAndDetails">
<xsd:complexType name="movies">
<xsd:sequence>
<xsd:element name="Title" type="xsd:string"/>
<xsd:element name="Director" type="xsd:string"></xsd:element>
<xsd:element name="Year" type="xsd:int"/>
<xsd:element ref="Actor"/>
<xsd:element ref="numberOfCast"/>
<xsd:element ref="releaseDate"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="movieDetails">
<xsd:sequence>
<xsd:element name="Actor" type="xsd:string"/>
<xsd:element name="numberOfCast" type="xsd:int"> </xsd:element>
<xsd:element name="releaseDate" type="xsd:date"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
xml xsd xml-schema-collection
I have a xml schema like the one being shown below but I have noticed that it would be very complicated to maintain.
I want to improve the current schema in one of the following ways but I am not sure if they would be the best/correct route:
Option 1: Use a reference of all elements of movieDetails
within movies
.
Option 2: Add movieDetails
as a sub-element of movies
(which I frankly am struggling to achieve)
Which route would be best and what would be the best way to structure it?
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://xml.netbeans.org/schema/AmazingMovies"
xmlns:tns="http://xml.netbeans.org/schema/AmazingMovies"
elementFormDefault="qualified">
<xsd:complexType name="movies">
<xsd:sequence>
<xsd:element name="Title" type="xsd:string"/>
<xsd:element name="Director" type="xsd:string"></xsd:element>
<xsd:element name="Year" type="xsd:int"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="movieDetails">
<xsd:sequence>
<xsd:element name="Actor" type="xsd:string"/>
<xsd:element name="numberOfCast" type="xsd:int"></xsd:element>
<xsd:element name="releaseDate" type="xsd:date"/>
</xsd:sequence>
</xsd:complexType>
<xsd:element name="OnDisplay">
<xsd:complexType>
<xsd:sequence >
<xsd:element name="collectionOfMovies" type="tns:movies" minOccurs="0" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>
Extra information
OnDisplay
element would add all elements ofmovies
into a list in order to use them when unMarshalling. However, I want to also addmovieDetails
ontoOnDisplay
, therefore, it would be convenient to have them included inmovies
as a ref, sub-element or another form.
Tried the following methods but failed XML validation
Method 1
<xsd:element name="MoviesAndDetails">
<xsd:complexType name="movies">
<xsd:sequence>
<xsd:element name="Title" type="xsd:string"/>
<xsd:element name="Director" type="xsd:string"></xsd:element>
<xsd:element name="Year" type="xsd:int"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="movieDetails">
<xsd:sequence>
<xsd:element name="Actor" type="xsd:string"/>
<xsd:element name="numberOfCast" type="xsd:int"> </xsd:element>
<xsd:element name="releaseDate" type="xsd:date"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
Method 2
<xsd:complexType name="MoviesAndDetails">
<xsd:complexType name="movies">
<xsd:sequence>
<xsd:element name="Title" type="xsd:string"/>
<xsd:element name="Director" type="xsd:string"></xsd:element>
<xsd:element name="Year" type="xsd:int"/>
<xsd:element ref="Actor"/>
<xsd:element ref="numberOfCast"/>
<xsd:element ref="releaseDate"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="movieDetails">
<xsd:sequence>
<xsd:element name="Actor" type="xsd:string"/>
<xsd:element name="numberOfCast" type="xsd:int"> </xsd:element>
<xsd:element name="releaseDate" type="xsd:date"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
xml xsd xml-schema-collection
xml xsd xml-schema-collection
asked Nov 29 '18 at 1:22
JCassioJCassio
416
416
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
If you want to have a movieDetails
element as a child of collectionOfMovies
, then you could add a movieDetails
element of type tns:movieDetails
to the sequence of movies
elements.
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://xml.netbeans.org/schema/AmazingMovies"
xmlns:tns="http://xml.netbeans.org/schema/AmazingMovies"
elementFormDefault="qualified">
<xsd:complexType name="movies">
<xsd:sequence>
<xsd:element name="Title" type="xsd:string"/>
<xsd:element name="Director" type="xsd:string"></xsd:element>
<xsd:element name="Year" type="xsd:int"/>
<xsd:element name="movieDetails" type="tns:movieDetails"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="movieDetails">
<xsd:sequence>
<xsd:element name="Actor" type="xsd:string"/>
<xsd:element name="numberOfCast" type="xsd:int"></xsd:element>
<xsd:element name="releaseDate" type="xsd:date"/>
</xsd:sequence>
</xsd:complexType>
<xsd:element name="OnDisplay">
<xsd:complexType>
<xsd:sequence >
<xsd:element name="collectionOfMovies" type="tns:movies" minOccurs="0" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>
Thank you... That's exactly what I needed. Just didn't know how to add another element as a child element.
– JCassio
Nov 29 '18 at 13:33
I would like to receive one more input from you if possible... I was able to create a JAXB Binding in order to unMarshall the XML. I have created the object as followsOnDisplays todaysShow = new Ondisplays(); List<movies> movies_today = todaysShow.getMovieCollection();
Nonetheless, I am able to set elements such asTitle
,Director
andYear
, however, I thought that I would be able to also set elements of movieDetails this way but it only presentssetmovieDetails
and not the elements contained in it. How can I achieve this?
– JCassio
Nov 29 '18 at 23:57
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53530524%2fhow-to-improve-xml-schema-with-sub-elements-or-references%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
If you want to have a movieDetails
element as a child of collectionOfMovies
, then you could add a movieDetails
element of type tns:movieDetails
to the sequence of movies
elements.
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://xml.netbeans.org/schema/AmazingMovies"
xmlns:tns="http://xml.netbeans.org/schema/AmazingMovies"
elementFormDefault="qualified">
<xsd:complexType name="movies">
<xsd:sequence>
<xsd:element name="Title" type="xsd:string"/>
<xsd:element name="Director" type="xsd:string"></xsd:element>
<xsd:element name="Year" type="xsd:int"/>
<xsd:element name="movieDetails" type="tns:movieDetails"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="movieDetails">
<xsd:sequence>
<xsd:element name="Actor" type="xsd:string"/>
<xsd:element name="numberOfCast" type="xsd:int"></xsd:element>
<xsd:element name="releaseDate" type="xsd:date"/>
</xsd:sequence>
</xsd:complexType>
<xsd:element name="OnDisplay">
<xsd:complexType>
<xsd:sequence >
<xsd:element name="collectionOfMovies" type="tns:movies" minOccurs="0" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>
Thank you... That's exactly what I needed. Just didn't know how to add another element as a child element.
– JCassio
Nov 29 '18 at 13:33
I would like to receive one more input from you if possible... I was able to create a JAXB Binding in order to unMarshall the XML. I have created the object as followsOnDisplays todaysShow = new Ondisplays(); List<movies> movies_today = todaysShow.getMovieCollection();
Nonetheless, I am able to set elements such asTitle
,Director
andYear
, however, I thought that I would be able to also set elements of movieDetails this way but it only presentssetmovieDetails
and not the elements contained in it. How can I achieve this?
– JCassio
Nov 29 '18 at 23:57
add a comment |
If you want to have a movieDetails
element as a child of collectionOfMovies
, then you could add a movieDetails
element of type tns:movieDetails
to the sequence of movies
elements.
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://xml.netbeans.org/schema/AmazingMovies"
xmlns:tns="http://xml.netbeans.org/schema/AmazingMovies"
elementFormDefault="qualified">
<xsd:complexType name="movies">
<xsd:sequence>
<xsd:element name="Title" type="xsd:string"/>
<xsd:element name="Director" type="xsd:string"></xsd:element>
<xsd:element name="Year" type="xsd:int"/>
<xsd:element name="movieDetails" type="tns:movieDetails"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="movieDetails">
<xsd:sequence>
<xsd:element name="Actor" type="xsd:string"/>
<xsd:element name="numberOfCast" type="xsd:int"></xsd:element>
<xsd:element name="releaseDate" type="xsd:date"/>
</xsd:sequence>
</xsd:complexType>
<xsd:element name="OnDisplay">
<xsd:complexType>
<xsd:sequence >
<xsd:element name="collectionOfMovies" type="tns:movies" minOccurs="0" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>
Thank you... That's exactly what I needed. Just didn't know how to add another element as a child element.
– JCassio
Nov 29 '18 at 13:33
I would like to receive one more input from you if possible... I was able to create a JAXB Binding in order to unMarshall the XML. I have created the object as followsOnDisplays todaysShow = new Ondisplays(); List<movies> movies_today = todaysShow.getMovieCollection();
Nonetheless, I am able to set elements such asTitle
,Director
andYear
, however, I thought that I would be able to also set elements of movieDetails this way but it only presentssetmovieDetails
and not the elements contained in it. How can I achieve this?
– JCassio
Nov 29 '18 at 23:57
add a comment |
If you want to have a movieDetails
element as a child of collectionOfMovies
, then you could add a movieDetails
element of type tns:movieDetails
to the sequence of movies
elements.
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://xml.netbeans.org/schema/AmazingMovies"
xmlns:tns="http://xml.netbeans.org/schema/AmazingMovies"
elementFormDefault="qualified">
<xsd:complexType name="movies">
<xsd:sequence>
<xsd:element name="Title" type="xsd:string"/>
<xsd:element name="Director" type="xsd:string"></xsd:element>
<xsd:element name="Year" type="xsd:int"/>
<xsd:element name="movieDetails" type="tns:movieDetails"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="movieDetails">
<xsd:sequence>
<xsd:element name="Actor" type="xsd:string"/>
<xsd:element name="numberOfCast" type="xsd:int"></xsd:element>
<xsd:element name="releaseDate" type="xsd:date"/>
</xsd:sequence>
</xsd:complexType>
<xsd:element name="OnDisplay">
<xsd:complexType>
<xsd:sequence >
<xsd:element name="collectionOfMovies" type="tns:movies" minOccurs="0" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>
If you want to have a movieDetails
element as a child of collectionOfMovies
, then you could add a movieDetails
element of type tns:movieDetails
to the sequence of movies
elements.
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://xml.netbeans.org/schema/AmazingMovies"
xmlns:tns="http://xml.netbeans.org/schema/AmazingMovies"
elementFormDefault="qualified">
<xsd:complexType name="movies">
<xsd:sequence>
<xsd:element name="Title" type="xsd:string"/>
<xsd:element name="Director" type="xsd:string"></xsd:element>
<xsd:element name="Year" type="xsd:int"/>
<xsd:element name="movieDetails" type="tns:movieDetails"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="movieDetails">
<xsd:sequence>
<xsd:element name="Actor" type="xsd:string"/>
<xsd:element name="numberOfCast" type="xsd:int"></xsd:element>
<xsd:element name="releaseDate" type="xsd:date"/>
</xsd:sequence>
</xsd:complexType>
<xsd:element name="OnDisplay">
<xsd:complexType>
<xsd:sequence >
<xsd:element name="collectionOfMovies" type="tns:movies" minOccurs="0" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>
answered Nov 29 '18 at 1:32
Mads HansenMads Hansen
45k1195122
45k1195122
Thank you... That's exactly what I needed. Just didn't know how to add another element as a child element.
– JCassio
Nov 29 '18 at 13:33
I would like to receive one more input from you if possible... I was able to create a JAXB Binding in order to unMarshall the XML. I have created the object as followsOnDisplays todaysShow = new Ondisplays(); List<movies> movies_today = todaysShow.getMovieCollection();
Nonetheless, I am able to set elements such asTitle
,Director
andYear
, however, I thought that I would be able to also set elements of movieDetails this way but it only presentssetmovieDetails
and not the elements contained in it. How can I achieve this?
– JCassio
Nov 29 '18 at 23:57
add a comment |
Thank you... That's exactly what I needed. Just didn't know how to add another element as a child element.
– JCassio
Nov 29 '18 at 13:33
I would like to receive one more input from you if possible... I was able to create a JAXB Binding in order to unMarshall the XML. I have created the object as followsOnDisplays todaysShow = new Ondisplays(); List<movies> movies_today = todaysShow.getMovieCollection();
Nonetheless, I am able to set elements such asTitle
,Director
andYear
, however, I thought that I would be able to also set elements of movieDetails this way but it only presentssetmovieDetails
and not the elements contained in it. How can I achieve this?
– JCassio
Nov 29 '18 at 23:57
Thank you... That's exactly what I needed. Just didn't know how to add another element as a child element.
– JCassio
Nov 29 '18 at 13:33
Thank you... That's exactly what I needed. Just didn't know how to add another element as a child element.
– JCassio
Nov 29 '18 at 13:33
I would like to receive one more input from you if possible... I was able to create a JAXB Binding in order to unMarshall the XML. I have created the object as follows
OnDisplays todaysShow = new Ondisplays(); List<movies> movies_today = todaysShow.getMovieCollection();
Nonetheless, I am able to set elements such as Title
, Director
and Year
, however, I thought that I would be able to also set elements of movieDetails this way but it only presents setmovieDetails
and not the elements contained in it. How can I achieve this?– JCassio
Nov 29 '18 at 23:57
I would like to receive one more input from you if possible... I was able to create a JAXB Binding in order to unMarshall the XML. I have created the object as follows
OnDisplays todaysShow = new Ondisplays(); List<movies> movies_today = todaysShow.getMovieCollection();
Nonetheless, I am able to set elements such as Title
, Director
and Year
, however, I thought that I would be able to also set elements of movieDetails this way but it only presents setmovieDetails
and not the elements contained in it. How can I achieve this?– JCassio
Nov 29 '18 at 23:57
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53530524%2fhow-to-improve-xml-schema-with-sub-elements-or-references%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown