Error msg when validating with schema
This should cover W3C XML Schema, Relax NG and DTD related problems.
			- 
				Douha
 - Posts: 17
 - Joined: Fri Aug 19, 2005 6:02 pm
 
Error msg when validating with schema
Hi all,
I am trying to validate an xml file using a an w3 schema. Here is the namespace line for the schema. <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="unqualified" attributeFormDefault="unqualified">
The xml file that I am validating does not contain a couple of fields that are defined in the schema. When I do the validation, I get this message;
cvc-complex-type.2.4.a: Invalid content was found starting with element.
How do I code the schema to show that some of the fields are not mandatory?
Thanks,
Doug Harding
State of Utah / Division of Finance
			
			
									
									
						I am trying to validate an xml file using a an w3 schema. Here is the namespace line for the schema. <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="unqualified" attributeFormDefault="unqualified">
The xml file that I am validating does not contain a couple of fields that are defined in the schema. When I do the validation, I get this message;
cvc-complex-type.2.4.a: Invalid content was found starting with element.
How do I code the schema to show that some of the fields are not mandatory?
Thanks,
Doug Harding
State of Utah / Division of Finance
- 
				sorin_ristache
 - Posts: 4141
 - Joined: Fri Mar 28, 2003 2:12 pm
 
Post by sorin_ristache »
Hi,
Use the choice element or the minOccurs="0" attribute.
Best Regards,
Sorin
			
			
									
									
						Use the choice element or the minOccurs="0" attribute.
Best Regards,
Sorin
			
				Jump to
				
			
		
			
			
	
	- Oxygen XML Editor/Author/Developer
 - ↳ Feature Request
 - ↳ Common Problems
 - ↳ DITA (Editing and Publishing DITA Content)
 - ↳ Artificial Intelligence (AI Positron Assistant add-on)
 - ↳ SDK-API, Frameworks - Document Types
 - ↳ DocBook
 - ↳ TEI
 - ↳ XHTML
 - ↳ Other Issues
 - Oxygen XML Web Author
 - ↳ Feature Request
 - ↳ Common Problems
 - Oxygen Content Fusion
 - ↳ Feature Request
 - ↳ Common Problems
 - Oxygen JSON Editor
 - ↳ Feature Request
 - ↳ Common Problems
 - Oxygen PDF Chemistry
 - ↳ Feature Request
 - ↳ Common Problems
 - Oxygen Feedback
 - ↳ Feature Request
 - ↳ Common Problems
 - Oxygen XML WebHelp
 - ↳ Feature Request
 - ↳ Common Problems
 - XML
 - ↳ General XML Questions
 - ↳ XSLT and FOP
 - ↳ XML Schemas
 - ↳ XQuery
 - NVDL
 - ↳ General NVDL Issues
 - ↳ oNVDL Related Issues
 - XML Services Market
 - ↳ Offer a Service