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 Certification (SCDJWS/OCEJWSD) and the fly likes Another question about xmlschema in web services. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Web Services Certification (SCDJWS/OCEJWSD)
Bookmark "Another question about xmlschema in web services." Watch "Another question about xmlschema in web services." New topic
Author

Another question about xmlschema in web services.

Rahul Ba
Ranch Hand

Joined: Oct 01, 2008
Posts: 205



Elements with values:



so, above XML document is the correct as shown in book. My question is a how is that? when we say minOccurs=0 then how it could have record in XML document like
<minOccursElem>5</minOccursElem> ?

There should not be this record because it has minOccurs="0"

Please explain me in detail....
Remko Strating
Ranch Hand

Joined: Dec 28, 2006
Posts: 893
The default value of minOccurs and maxOccurs is 1. So if you don't specify a value the element should be exactly present once. Now in your example you have set the minOccurs value to 0, but you haven't set the maxOccurs value which will have the default value. This means that the maxOccurs is 1. Now this element could be present 0 or 1 times. In your example this element is present 1 time which is within the valid range.


Remko (My website)
SCJP 1.5, SCWCD 1.4, SCDJWS 1.4, SCBCD 1.5, ITIL(Manager), Prince2(Practitioner), Reading/ gaining experience for SCEA,
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Another question about xmlschema in web services.