Thanks Gregory,
you mean it must be so defined
<xs:element name="workSince" type="xs:positiveInteger" nillable="true"
minOccurs="0"/>
but for this case follow possible definitions in xml
(1) <workSince xsi:nil="true"/>
(2) <!-- workSince is not defined in xml -->
are equals. Is it?
I work in project, where definition (1) widely used. It works with JDOM.
Instead of JDOM I must use castor.
I have very many clients, which sends me XML's with definitions (1) ! This is my
problem.
I can't correct all client applications - too big effort.
Any clue more?
Thanks,
Robert
-----Urspr�ngliche Nachricht-----
Von: Gregory Block [mailto:[EMAIL PROTECTED]
Gesendet: Freitag, 16. April 2004 10:40
An: [EMAIL PROTECTED]
Betreff: Re: [castor-dev] ValidationException for field with definition:
type="xsi:positiveInteger" and nillable="true"
On 14 Apr 2004, at 10:08, Gevorkov, Robert wrote:
>> I have an element called 'workSince' declared in my schema with
>> nillable="true" attribute. It is also of type="xs:positiveInteger"
>> and this is a problem.
>> I have the follow XSD definition:
Nillable is processed by castor - but xs:positiveInteger, as a type,
requires a value of 1 if the value is present at all. You're getting
caught by the difference between what's required by the schema, and
what you're OK with setting in the object. Setting nillable to true
does not permit 0 when doing XML validation; that's a mapping directive
- setting the type of xs:positiveInteger ensures that.
If you really want 0, that type should be nonNegativeInteger, which is
0..n, instead of positiveInteger, which, by definition, is 1..n.
I think. Someone yell at me if I'm way off base on that. :)
-----------------------------------------------------------
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
unsubscribe castor-dev
-----------------------------------------------------------
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
unsubscribe castor-dev