XSD Schema Error - cvc-complex-type.2.4b: Element not allowed: settingvalue in element settinggroup
I have an issue with my XSD Schema. I keep getting the error mentioned in the title. I don't understand why it says that a certain element is not allowed in another. It doesn't complain about the 'accessrights'
but it does about the 'settingvalue'
when both of them are essentially the same (just a few basic elements; strings and booleans).
Does anyone have an idea about why it's complaining? I am using Apache XMLBeans 3.0.1
(from the Windows 10 CMD) to try and validate the schema.
The XSD Schema file, in its entirety.
<?xml version="1.0" encoding="UTF-8" ?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<!-- Define the simple elements -->
<xs:element name="creationtime" type="xs:string"/>
<xs:element name="customerkey" type="xs:string"/>
<xs:element name="dependency" type="xs:string"/>
<xs:element name="description" type="xs:string"/>
<xs:element name="enable" type="xs:boolean"/>
<xs:element name="group_id" type="xs:string"/>
<xs:element name="groupname" type="xs:string"/>
<xs:element name="iamid" type="xs:string"/>
<xs:element name="id" type="xs:string"/>
<xs:element name="name" type="xs:string"/>
<xs:element name="readonly" type="xs:boolean"/>
<xs:element name="settingscategory" type="xs:string"/>
<xs:element name="show" type="xs:boolean"/>
<xs:element name="specification_id" type="xs:string"/>
<xs:element name="value" type="xs:string"/>
<xs:element name="valuepack" type="xs:string"/>
<!-- Define the 'accessrights' element -->
<xs:element name="accessrights">
<xs:complexType>
<xs:sequence>
<xs:element ref="id"/>
<xs:element ref="show"/>
<xs:element ref="readonly"/>
<xs:element ref="enable"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<!-- Define the 'settingvalue' element -->
<xs:element name="settingvalue">
<xs:complexType>
<xs:sequence>
<xs:element ref="id"/>
<xs:element ref="specification_id"/>
<xs:element ref="value"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<!-- Define the 'settingsgroup' element -->
<xs:element name="settingsgroup">
<xs:complexType>
<xs:sequence>
<xs:element ref="group_id"/>
<xs:element ref="groupname"/>
<xs:element ref="accessrights" minOccurs="0"/>
<xs:element ref="settingvalue"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<!-- Define the 'settings' element -->
<xs:element name="settings">
<xs:complexType>
<xs:sequence>
<xs:element ref="id"/>
<xs:element ref="settingscategory"/>
<xs:element ref="name"/>
<xs:element ref="settingsgroup" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<!-- Define the 'license' element -->
<xs:element name="license">
<xs:complexType>
<xs:sequence>
<xs:element ref="id"/>
<xs:element ref="dependency" minOccurs="0" maxOccurs="unbounded"/>
<xs:element ref="name"/>
<xs:element ref="creationtime" minOccurs="0"/>
<xs:element ref="valuepack" minOccurs="0"/>
<xs:element ref="iamid" minOccurs="0"/>
<xs:element ref="customerkey" minOccurs="0"/>
<xs:element ref="description" minOccurs="0"/>
<xs:element ref="settings"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
An example of how an XML that conforms to the schema might look like
<license>
<id>IDString</id>
<dependency>IDStringOfOtherLicense</dependency>
<name>LicenseName</name>
<creationtime>2016-08-17 10:05:00</creationtime>
<customerkey>googlemaybe</customerkey>
<description>importantDetails</description>
<settings>
<id>IDString</id>
<settingscategory>license</settingscategory>
<name>SettingName</name>
<settingsgroup>
<group_id>groupIDString</group_id>
<groupname>oldstuff</groupname>
<settingvalue>
<id>IDString</id>
<specification_id>specIDString</specification_id>
<value>true</value>
</settingvalue>
</settingsgroup>
</settings>
</license>
xml apache validation xsd xmlbeans
add a comment |
I have an issue with my XSD Schema. I keep getting the error mentioned in the title. I don't understand why it says that a certain element is not allowed in another. It doesn't complain about the 'accessrights'
but it does about the 'settingvalue'
when both of them are essentially the same (just a few basic elements; strings and booleans).
Does anyone have an idea about why it's complaining? I am using Apache XMLBeans 3.0.1
(from the Windows 10 CMD) to try and validate the schema.
The XSD Schema file, in its entirety.
<?xml version="1.0" encoding="UTF-8" ?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<!-- Define the simple elements -->
<xs:element name="creationtime" type="xs:string"/>
<xs:element name="customerkey" type="xs:string"/>
<xs:element name="dependency" type="xs:string"/>
<xs:element name="description" type="xs:string"/>
<xs:element name="enable" type="xs:boolean"/>
<xs:element name="group_id" type="xs:string"/>
<xs:element name="groupname" type="xs:string"/>
<xs:element name="iamid" type="xs:string"/>
<xs:element name="id" type="xs:string"/>
<xs:element name="name" type="xs:string"/>
<xs:element name="readonly" type="xs:boolean"/>
<xs:element name="settingscategory" type="xs:string"/>
<xs:element name="show" type="xs:boolean"/>
<xs:element name="specification_id" type="xs:string"/>
<xs:element name="value" type="xs:string"/>
<xs:element name="valuepack" type="xs:string"/>
<!-- Define the 'accessrights' element -->
<xs:element name="accessrights">
<xs:complexType>
<xs:sequence>
<xs:element ref="id"/>
<xs:element ref="show"/>
<xs:element ref="readonly"/>
<xs:element ref="enable"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<!-- Define the 'settingvalue' element -->
<xs:element name="settingvalue">
<xs:complexType>
<xs:sequence>
<xs:element ref="id"/>
<xs:element ref="specification_id"/>
<xs:element ref="value"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<!-- Define the 'settingsgroup' element -->
<xs:element name="settingsgroup">
<xs:complexType>
<xs:sequence>
<xs:element ref="group_id"/>
<xs:element ref="groupname"/>
<xs:element ref="accessrights" minOccurs="0"/>
<xs:element ref="settingvalue"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<!-- Define the 'settings' element -->
<xs:element name="settings">
<xs:complexType>
<xs:sequence>
<xs:element ref="id"/>
<xs:element ref="settingscategory"/>
<xs:element ref="name"/>
<xs:element ref="settingsgroup" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<!-- Define the 'license' element -->
<xs:element name="license">
<xs:complexType>
<xs:sequence>
<xs:element ref="id"/>
<xs:element ref="dependency" minOccurs="0" maxOccurs="unbounded"/>
<xs:element ref="name"/>
<xs:element ref="creationtime" minOccurs="0"/>
<xs:element ref="valuepack" minOccurs="0"/>
<xs:element ref="iamid" minOccurs="0"/>
<xs:element ref="customerkey" minOccurs="0"/>
<xs:element ref="description" minOccurs="0"/>
<xs:element ref="settings"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
An example of how an XML that conforms to the schema might look like
<license>
<id>IDString</id>
<dependency>IDStringOfOtherLicense</dependency>
<name>LicenseName</name>
<creationtime>2016-08-17 10:05:00</creationtime>
<customerkey>googlemaybe</customerkey>
<description>importantDetails</description>
<settings>
<id>IDString</id>
<settingscategory>license</settingscategory>
<name>SettingName</name>
<settingsgroup>
<group_id>groupIDString</group_id>
<groupname>oldstuff</groupname>
<settingvalue>
<id>IDString</id>
<specification_id>specIDString</specification_id>
<value>true</value>
</settingvalue>
</settingsgroup>
</settings>
</license>
xml apache validation xsd xmlbeans
The schema says "settingsgroup" but your title says "settinggroup" - is that significant. You've left out the important information for diagnosis - the instance document, and the namespace declarations in the schema.
– Michael Kay
Nov 14 '18 at 17:00
I have updated the question to have the whole XSD file, and I have added an example XML that should fit it.
– Anju Maaka
Nov 15 '18 at 8:12
According to Saxon, this instance document is valid against this schema. Try looking carefully at how you are running the validation, e.g. are you picking up the right versions of files.
– Michael Kay
Nov 15 '18 at 9:20
Strangely enough, it does work now. I did doublecheck it yesterday but it refused to work (I even saved the command from yesterday an copy-pasted it so I used the same today). Maybe it was some interference from Eclipse...
– Anju Maaka
Nov 15 '18 at 9:54
I FOUND THE PROBLEM!! I designed my XSD by studying some of the over 40 XML files (licenses) that it should match, but I only looked at like 10 of them. Turns out a rare few have more than one settingvalue in a single settingsgroup so I just had to add a maxOccurs="unbounded" there to fix it
– Anju Maaka
Nov 15 '18 at 10:15
add a comment |
I have an issue with my XSD Schema. I keep getting the error mentioned in the title. I don't understand why it says that a certain element is not allowed in another. It doesn't complain about the 'accessrights'
but it does about the 'settingvalue'
when both of them are essentially the same (just a few basic elements; strings and booleans).
Does anyone have an idea about why it's complaining? I am using Apache XMLBeans 3.0.1
(from the Windows 10 CMD) to try and validate the schema.
The XSD Schema file, in its entirety.
<?xml version="1.0" encoding="UTF-8" ?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<!-- Define the simple elements -->
<xs:element name="creationtime" type="xs:string"/>
<xs:element name="customerkey" type="xs:string"/>
<xs:element name="dependency" type="xs:string"/>
<xs:element name="description" type="xs:string"/>
<xs:element name="enable" type="xs:boolean"/>
<xs:element name="group_id" type="xs:string"/>
<xs:element name="groupname" type="xs:string"/>
<xs:element name="iamid" type="xs:string"/>
<xs:element name="id" type="xs:string"/>
<xs:element name="name" type="xs:string"/>
<xs:element name="readonly" type="xs:boolean"/>
<xs:element name="settingscategory" type="xs:string"/>
<xs:element name="show" type="xs:boolean"/>
<xs:element name="specification_id" type="xs:string"/>
<xs:element name="value" type="xs:string"/>
<xs:element name="valuepack" type="xs:string"/>
<!-- Define the 'accessrights' element -->
<xs:element name="accessrights">
<xs:complexType>
<xs:sequence>
<xs:element ref="id"/>
<xs:element ref="show"/>
<xs:element ref="readonly"/>
<xs:element ref="enable"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<!-- Define the 'settingvalue' element -->
<xs:element name="settingvalue">
<xs:complexType>
<xs:sequence>
<xs:element ref="id"/>
<xs:element ref="specification_id"/>
<xs:element ref="value"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<!-- Define the 'settingsgroup' element -->
<xs:element name="settingsgroup">
<xs:complexType>
<xs:sequence>
<xs:element ref="group_id"/>
<xs:element ref="groupname"/>
<xs:element ref="accessrights" minOccurs="0"/>
<xs:element ref="settingvalue"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<!-- Define the 'settings' element -->
<xs:element name="settings">
<xs:complexType>
<xs:sequence>
<xs:element ref="id"/>
<xs:element ref="settingscategory"/>
<xs:element ref="name"/>
<xs:element ref="settingsgroup" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<!-- Define the 'license' element -->
<xs:element name="license">
<xs:complexType>
<xs:sequence>
<xs:element ref="id"/>
<xs:element ref="dependency" minOccurs="0" maxOccurs="unbounded"/>
<xs:element ref="name"/>
<xs:element ref="creationtime" minOccurs="0"/>
<xs:element ref="valuepack" minOccurs="0"/>
<xs:element ref="iamid" minOccurs="0"/>
<xs:element ref="customerkey" minOccurs="0"/>
<xs:element ref="description" minOccurs="0"/>
<xs:element ref="settings"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
An example of how an XML that conforms to the schema might look like
<license>
<id>IDString</id>
<dependency>IDStringOfOtherLicense</dependency>
<name>LicenseName</name>
<creationtime>2016-08-17 10:05:00</creationtime>
<customerkey>googlemaybe</customerkey>
<description>importantDetails</description>
<settings>
<id>IDString</id>
<settingscategory>license</settingscategory>
<name>SettingName</name>
<settingsgroup>
<group_id>groupIDString</group_id>
<groupname>oldstuff</groupname>
<settingvalue>
<id>IDString</id>
<specification_id>specIDString</specification_id>
<value>true</value>
</settingvalue>
</settingsgroup>
</settings>
</license>
xml apache validation xsd xmlbeans
I have an issue with my XSD Schema. I keep getting the error mentioned in the title. I don't understand why it says that a certain element is not allowed in another. It doesn't complain about the 'accessrights'
but it does about the 'settingvalue'
when both of them are essentially the same (just a few basic elements; strings and booleans).
Does anyone have an idea about why it's complaining? I am using Apache XMLBeans 3.0.1
(from the Windows 10 CMD) to try and validate the schema.
The XSD Schema file, in its entirety.
<?xml version="1.0" encoding="UTF-8" ?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<!-- Define the simple elements -->
<xs:element name="creationtime" type="xs:string"/>
<xs:element name="customerkey" type="xs:string"/>
<xs:element name="dependency" type="xs:string"/>
<xs:element name="description" type="xs:string"/>
<xs:element name="enable" type="xs:boolean"/>
<xs:element name="group_id" type="xs:string"/>
<xs:element name="groupname" type="xs:string"/>
<xs:element name="iamid" type="xs:string"/>
<xs:element name="id" type="xs:string"/>
<xs:element name="name" type="xs:string"/>
<xs:element name="readonly" type="xs:boolean"/>
<xs:element name="settingscategory" type="xs:string"/>
<xs:element name="show" type="xs:boolean"/>
<xs:element name="specification_id" type="xs:string"/>
<xs:element name="value" type="xs:string"/>
<xs:element name="valuepack" type="xs:string"/>
<!-- Define the 'accessrights' element -->
<xs:element name="accessrights">
<xs:complexType>
<xs:sequence>
<xs:element ref="id"/>
<xs:element ref="show"/>
<xs:element ref="readonly"/>
<xs:element ref="enable"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<!-- Define the 'settingvalue' element -->
<xs:element name="settingvalue">
<xs:complexType>
<xs:sequence>
<xs:element ref="id"/>
<xs:element ref="specification_id"/>
<xs:element ref="value"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<!-- Define the 'settingsgroup' element -->
<xs:element name="settingsgroup">
<xs:complexType>
<xs:sequence>
<xs:element ref="group_id"/>
<xs:element ref="groupname"/>
<xs:element ref="accessrights" minOccurs="0"/>
<xs:element ref="settingvalue"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<!-- Define the 'settings' element -->
<xs:element name="settings">
<xs:complexType>
<xs:sequence>
<xs:element ref="id"/>
<xs:element ref="settingscategory"/>
<xs:element ref="name"/>
<xs:element ref="settingsgroup" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<!-- Define the 'license' element -->
<xs:element name="license">
<xs:complexType>
<xs:sequence>
<xs:element ref="id"/>
<xs:element ref="dependency" minOccurs="0" maxOccurs="unbounded"/>
<xs:element ref="name"/>
<xs:element ref="creationtime" minOccurs="0"/>
<xs:element ref="valuepack" minOccurs="0"/>
<xs:element ref="iamid" minOccurs="0"/>
<xs:element ref="customerkey" minOccurs="0"/>
<xs:element ref="description" minOccurs="0"/>
<xs:element ref="settings"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
An example of how an XML that conforms to the schema might look like
<license>
<id>IDString</id>
<dependency>IDStringOfOtherLicense</dependency>
<name>LicenseName</name>
<creationtime>2016-08-17 10:05:00</creationtime>
<customerkey>googlemaybe</customerkey>
<description>importantDetails</description>
<settings>
<id>IDString</id>
<settingscategory>license</settingscategory>
<name>SettingName</name>
<settingsgroup>
<group_id>groupIDString</group_id>
<groupname>oldstuff</groupname>
<settingvalue>
<id>IDString</id>
<specification_id>specIDString</specification_id>
<value>true</value>
</settingvalue>
</settingsgroup>
</settings>
</license>
xml apache validation xsd xmlbeans
xml apache validation xsd xmlbeans
edited Nov 15 '18 at 8:53
Daredevil
19211
19211
asked Nov 14 '18 at 15:04
Anju MaakaAnju Maaka
105
105
The schema says "settingsgroup" but your title says "settinggroup" - is that significant. You've left out the important information for diagnosis - the instance document, and the namespace declarations in the schema.
– Michael Kay
Nov 14 '18 at 17:00
I have updated the question to have the whole XSD file, and I have added an example XML that should fit it.
– Anju Maaka
Nov 15 '18 at 8:12
According to Saxon, this instance document is valid against this schema. Try looking carefully at how you are running the validation, e.g. are you picking up the right versions of files.
– Michael Kay
Nov 15 '18 at 9:20
Strangely enough, it does work now. I did doublecheck it yesterday but it refused to work (I even saved the command from yesterday an copy-pasted it so I used the same today). Maybe it was some interference from Eclipse...
– Anju Maaka
Nov 15 '18 at 9:54
I FOUND THE PROBLEM!! I designed my XSD by studying some of the over 40 XML files (licenses) that it should match, but I only looked at like 10 of them. Turns out a rare few have more than one settingvalue in a single settingsgroup so I just had to add a maxOccurs="unbounded" there to fix it
– Anju Maaka
Nov 15 '18 at 10:15
add a comment |
The schema says "settingsgroup" but your title says "settinggroup" - is that significant. You've left out the important information for diagnosis - the instance document, and the namespace declarations in the schema.
– Michael Kay
Nov 14 '18 at 17:00
I have updated the question to have the whole XSD file, and I have added an example XML that should fit it.
– Anju Maaka
Nov 15 '18 at 8:12
According to Saxon, this instance document is valid against this schema. Try looking carefully at how you are running the validation, e.g. are you picking up the right versions of files.
– Michael Kay
Nov 15 '18 at 9:20
Strangely enough, it does work now. I did doublecheck it yesterday but it refused to work (I even saved the command from yesterday an copy-pasted it so I used the same today). Maybe it was some interference from Eclipse...
– Anju Maaka
Nov 15 '18 at 9:54
I FOUND THE PROBLEM!! I designed my XSD by studying some of the over 40 XML files (licenses) that it should match, but I only looked at like 10 of them. Turns out a rare few have more than one settingvalue in a single settingsgroup so I just had to add a maxOccurs="unbounded" there to fix it
– Anju Maaka
Nov 15 '18 at 10:15
The schema says "settingsgroup" but your title says "settinggroup" - is that significant. You've left out the important information for diagnosis - the instance document, and the namespace declarations in the schema.
– Michael Kay
Nov 14 '18 at 17:00
The schema says "settingsgroup" but your title says "settinggroup" - is that significant. You've left out the important information for diagnosis - the instance document, and the namespace declarations in the schema.
– Michael Kay
Nov 14 '18 at 17:00
I have updated the question to have the whole XSD file, and I have added an example XML that should fit it.
– Anju Maaka
Nov 15 '18 at 8:12
I have updated the question to have the whole XSD file, and I have added an example XML that should fit it.
– Anju Maaka
Nov 15 '18 at 8:12
According to Saxon, this instance document is valid against this schema. Try looking carefully at how you are running the validation, e.g. are you picking up the right versions of files.
– Michael Kay
Nov 15 '18 at 9:20
According to Saxon, this instance document is valid against this schema. Try looking carefully at how you are running the validation, e.g. are you picking up the right versions of files.
– Michael Kay
Nov 15 '18 at 9:20
Strangely enough, it does work now. I did doublecheck it yesterday but it refused to work (I even saved the command from yesterday an copy-pasted it so I used the same today). Maybe it was some interference from Eclipse...
– Anju Maaka
Nov 15 '18 at 9:54
Strangely enough, it does work now. I did doublecheck it yesterday but it refused to work (I even saved the command from yesterday an copy-pasted it so I used the same today). Maybe it was some interference from Eclipse...
– Anju Maaka
Nov 15 '18 at 9:54
I FOUND THE PROBLEM!! I designed my XSD by studying some of the over 40 XML files (licenses) that it should match, but I only looked at like 10 of them. Turns out a rare few have more than one settingvalue in a single settingsgroup so I just had to add a maxOccurs="unbounded" there to fix it
– Anju Maaka
Nov 15 '18 at 10:15
I FOUND THE PROBLEM!! I designed my XSD by studying some of the over 40 XML files (licenses) that it should match, but I only looked at like 10 of them. Turns out a rare few have more than one settingvalue in a single settingsgroup so I just had to add a maxOccurs="unbounded" there to fix it
– Anju Maaka
Nov 15 '18 at 10:15
add a comment |
0
active
oldest
votes
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%2f53303192%2fxsd-schema-error-cvc-complex-type-2-4b-element-not-allowed-settingvalue-in-e%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
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%2f53303192%2fxsd-schema-error-cvc-complex-type-2-4b-element-not-allowed-settingvalue-in-e%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
The schema says "settingsgroup" but your title says "settinggroup" - is that significant. You've left out the important information for diagnosis - the instance document, and the namespace declarations in the schema.
– Michael Kay
Nov 14 '18 at 17:00
I have updated the question to have the whole XSD file, and I have added an example XML that should fit it.
– Anju Maaka
Nov 15 '18 at 8:12
According to Saxon, this instance document is valid against this schema. Try looking carefully at how you are running the validation, e.g. are you picking up the right versions of files.
– Michael Kay
Nov 15 '18 at 9:20
Strangely enough, it does work now. I did doublecheck it yesterday but it refused to work (I even saved the command from yesterday an copy-pasted it so I used the same today). Maybe it was some interference from Eclipse...
– Anju Maaka
Nov 15 '18 at 9:54
I FOUND THE PROBLEM!! I designed my XSD by studying some of the over 40 XML files (licenses) that it should match, but I only looked at like 10 of them. Turns out a rare few have more than one settingvalue in a single settingsgroup so I just had to add a maxOccurs="unbounded" there to fix it
– Anju Maaka
Nov 15 '18 at 10:15