Subject:Newbie question? Author:Mans Larsson Date:15 Dec 2005 04:20 AM
Hello,
I have a problem, that is probably not related to Stylus Studio, probably related to me and my lack of knowledge... But I was hoping to get some help anyway.
I have made a XML and a XSD file to go with it. Everything works fine except for one thing; I get; "file:///c:/dev/kdb.xml:63,106: Element 'product' is not valid for content model: '((title,isbn," and so on...
It seems to me that my XSD does not allow XML-blocks that are not "complete", ie. Not containing all the elements described in the XSD? If so, how can I overcome this issue?
Sorry to put this lame question here, but I have searched the net for answers without getting anywhere...
Here is some snippets from my XML and XSD (it's to large to post in full here);
Subject:Newbie question? Author:Minollo I. Date:15 Dec 2005 08:55 AM
Mans,
from what I can see from the fragments you posted, your schema is saying that a "product" *must* have one and only one "title"; that's what minOccurs and maxOccurs mean in:
<xs:element name="title" type="titleType" minOccurs="1" maxOccurs="1"/>
But in your XML you have:
<product type="delete" originator-id="XX" originator-item-id="123456" />
...which is clearly wrong according to what the schema says.
If you want to allow "product"'s with no "title"'s then you'll need to change the "title" definition in the schema to be:
<xs:element name="title" type="titleType" minOccurs="0" maxOccurs="1"/>