File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Web Services and the fly likes Problem related to XML validation using XSD Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "Problem related to XML validation using XSD" Watch "Problem related to XML validation using XSD" New topic
Author

Problem related to XML validation using XSD

Karn Kumar
Ranch Hand

Joined: Aug 06, 2009
Posts: 143

Hi All ,


Can anyone suggest why i m getting the following error

cvc-complex-type.2.4.d: Invalid content was found starting with element 'ROEInfo'. No child element is expected at this point.



Here are my xml :--


Here is my XSD :--






Thanks ,

Ivan Krizsan
Ranch Hand

Joined: Oct 04, 2006
Posts: 2198
    
    1
Hi!
Your schema says that the <ROEList> element may contain exactly one <ROEInfo> child element.
This happens because the default value of maxOccurs is one and you have only specified minOccurs=1 here:

Best wishes!


My free books and tutorials: http://www.slideshare.net/krizsan
Karn Kumar
Ranch Hand

Joined: Aug 06, 2009
Posts: 143

Thanks Ivan ,

I got the solution ...you are correct..

I have set the maxOccurance="unbounded" and it works perfectly.


Good day...
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Problem related to XML validation using XSD
 
Similar Threads
What's wrong with this simpleType!
org.apache.axis2.AxisFault: org.apache.axis2.databinding.ADBException: Unexpected subelement
how to define array of stations in LoginResponse complex type
WDSL2Java using Axis2 via Ant in Eclipse
Solution for "cvc-elt.1: Cannot find the declaration of element xxx" in JAVA