I am very new to XML. I have a catalog element that contains movies and actors. This element can contain an arbitrary number (possibly 0) of actor and/or movie child elements, in any order. Here is the code I have for this so far:
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element ref="movie" />
<xs:element ref="actor" />
I believe this is correct for what I want to accomplish, however whenever I validate the xml document here is what I get:
File C:\Users\Julie\Documents\6006\Assignment 1\catalogtxt.xml is not valid.
Element <movie> is not allowed under element <cat:catalog>.
Reason: The following elements are expected at this location (see below)
Error location: cat:catalog / movie
Any help or suggestions would be greatly appreciated.
This topic has been locked.
1 reply Latest Post - 2011-02-13T14:08:25Z by SystemAdmin
Pinned topic XML Schema Question
Answered question This question has been answered.
Unanswered question This question has not been answered yet.
Updated on 2011-02-13T14:08:25Z at 2011-02-13T14:08:25Z by SystemAdmin
SystemAdmin 110000D4XK1830 PostsACCEPTED ANSWER
Re: XML Schema Question2011-02-13T14:08:25Z in response to jwellsThere are some pieces of information not explicit in order to give answer the problem without making bold assumption. I also suppose the xsd document is properly made in the first place.
>Element <movie> is not allowed under element <cat:catalog>.
This suggests you've made the namespace where catalog lives having a prefix cat. In that you have to make the same qualification to movie and actor, like this cat:movie and cat:actor everywhere under the cat:catalog.