Rank: Newbie
Joined: 3/29/2006 Posts: 4 Location: USA
|
Hello:
I was following the Tutorials to refresh basic concepts since I have been away from XML for a while. When I was following the instrcutions on Complex and Simple Types, I am running into an error situation. I created a simpletype called US-State. I then referenced it as the Type when I created a new element under US-Address called State.
But when I tried to save the file, it says that the file has errors. The error is not quite self-explanatory and I am not able to decipher what I did wrong.
What am I doing wrong?
File Attachment(s): XMLSPY_Error.docx (64kb) downloaded 444 time(s).
|
Rank: Newbie
Joined: 10/28/2002 Posts: 1,283 Location: AT
|
Hi,
if you expand the "Details" section in the Messages window it takes you to the pertinent part of the schema specification.
i.e.
Schema Component Constraint: Element Declarations Consistent
Code: If the {particles} contains, either directly, indirectly (that is, within the {particles} of a contained model group, recursively) or ·implicitly· two or more element declaration particles with the same {name} and {target namespace}, then all their type definitions must be the same top-level definition, that is, all of the following must be true:
1 all their {type definition}s must have a non-·absent· {name}. 2 all their {type definition}s must have the same {name}. 3 all their {type definition}s must have the same {target namespace}.
Basically the two "State" elements have to be of the same type. If this were not the case there may be situations in which it is not clear whether a "State" element in the xml instance document should be validated according to the "State" element which is of type "string" or the "State" element of type "US-State".element.
|