IMPORTANT:
this is not a Support Forum! Experienced users might answer from time to time questions posted here. If you need a professional and reliable answer, or if you want to report a bug, please contact Altova Support instead.

Running into error: Tutorial : SimpleType Options · View
vvenk
Posted: Monday, November 26, 2018 2:23:22 PM
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).


island
Posted: Tuesday, November 27, 2018 5:50:16 AM
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.
Users browsing this topic
guest

Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Use of the Altova User Forum(s) is governed by the Altova Terms of Use.