Preferred number of repetitions: the same behavior for maxOccurs as for minOccurs

Are you missing a feature? Request it's implementation here.
tatra603
Posts: 72
Joined: Fri Sep 17, 2004 10:53 am
Location: Prague, the Czech Republic, Europe

Preferred number of repetitions: the same behavior for maxOccurs as for minOccurs

Post by tatra603 » Mon Jan 14, 2013 9:36 pm

Hello,

I have on RFE. When using Generate Sample XML Files -> Options -> Settings -> Preferred number of repetitions, I would like to have some ability to generate maxOccurs element. As stated in "i" help:

n < minOccurs -> minOccurs
minOccurs < n -> n
n < maxOccurs -> n
maxOccurs < n -> n = THAT IS WHAT I DO NOT WANT TO HAVE IN RESULT, I WANT maxOccurs

Because I think, that in case maxOccurs < n -> n, the resulted XML would be invalid. In other words - it could be nice to have possibility to generate "largest XML as XSD allows" (and still valid XML).

Am I right? Thank You in advance for Your answer. Stepan

P.S. In "i" help is exactly written (the last statement is problem for me. And I do not know why that behavior was chosen. Maybe I missed something important regarding XML usage.

Option to set the preferred number of repeating elements related with minOccurs and maxOccurs defined in XML Schema.
If the value set here is between minOccurs and maxOccurs, that value will be used.
If the value set here is less than minOccurs, the minOccurs value will be used.
If the value set here is greater than maxOccurs, that value will be used.

adrian
Posts: 2666
Joined: Tue May 17, 2005 4:01 pm

Re: Preferred number of repetitions: the same behavior for maxOccurs as for minOccurs

Post by adrian » Wed Jan 16, 2013 7:09 pm

Hello,

So you are referring to the section Generate Sample XML Files from the documentation:
http://www.oxygenxml.com/doc/ug-editor/ ... rator.html
Preferred number of repetitions - Allows the user to set the preferred number of repeating elements related with minOccurs and maxOccurs facets defined in XML Schema.
- If the value set here is between minOccurs and maxOccurs, then that value is used;
- If the value set here is less than minOccurs, then the minOccurs value is used;
- If the value set here is greater than maxOccurs, then that value is used.
That's just a mistake in the documentation. I've checked in the code and if the value is greater than maxOccurs then maxOccurs is used.
Have you observed a different behavior in practice, or did you only notice this in the documentation?

Regards,
Adrian
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com

tatra603
Posts: 72
Joined: Fri Sep 17, 2004 10:53 am
Location: Prague, the Czech Republic, Europe

Re: Preferred number of repetitions: the same behavior for maxOccurs as for minOccurs

Post by tatra603 » Thu Jan 17, 2013 12:56 pm

Hello,

yeas, I read it in "fast documentation" ~ click on "i" sign in tool wizard. I did not nested then. I have tried it now and it works fine as I wanted.

Thank you. Stepan

adrian
Posts: 2666
Joined: Tue May 17, 2005 4:01 pm

Re: Preferred number of repetitions: the same behavior for maxOccurs as for minOccurs

Post by adrian » Thu Jan 17, 2013 1:18 pm

Hi,

I've submitted an issue for correcting this in our documentation (including the quick info from the dialog).

Regards,
Adrian
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com

Post Reply