You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-users@xerces.apache.org by Ender Oezguer <oe...@neofonie.de> on 2003/06/27 15:38:35 UTC

Re: schema validation and date datatype

Hi,

same case for e.g. 'xs:int' and 'xs:float'. Is there a switch for the 
validator to handle empty values ? Or any other ideas ?

Ender



O'Keeffe, Michael wrote:
> With String datatypes, if the element has an attribute with minOccurs="0",
> and the tag is there in the XML, but there is no value, validation is
> successful. 
> 
> However, when I run schema validation where the tag is there but the value
> is empty, I will get a schema validation error.  Here is an example:
> 
> Here's the schema fragment:
>         <element name="FOO_DATE" minOccurs="0" type="date" /> 
> 
> Here a fragment of the XML with FOO_DATE:
> 		<FOO_DATE/>
> 
> Here is the error:
> cvc-type.3.1.3: The value '' of element 'FOO_DATE' is not valid.
> 
> The only way this will successfully validate is if the tag <FOO_DATE/> is
> not in the xml document at all.
> 
> Is this the way it is supposed to work?  It doesn't seem consistent with
> other datatypes.
> 
> -Mike
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
> For additional commands, e-mail: xerces-j-user-help@xml.apache.org
> 


.................................................................
Ender Özgür            neofonie GmbH        Tel: +49.30.24627-329
Softwareentwicklung    Robert-Koch-Platz 4  FAX: +49.30.24627-120
oezguer@neofonie.de    D-10115 Berlin       Web: www.neofonie.de



---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.apache.org


Re: schema validation and date datatype

Posted by Maksym Kovalenko <mk...@marketswitch.com>.
 From general perspective I can say that empty string is a valid string 
- it's a string with length 0.
But other types are other types and empty value doesn't make any sense 
and invalid indeed.

I don't see any inconsistency at all.
I would be really surprised if there's a switch you're looking for.

Ender Oezguer wrote:

> Hi,
>
> same case for e.g. 'xs:int' and 'xs:float'. Is there a switch for the 
> validator to handle empty values ? Or any other ideas ?
>
> Ender
>
>
>
> O'Keeffe, Michael wrote:
>
>> With String datatypes, if the element has an attribute with 
>> minOccurs="0",
>> and the tag is there in the XML, but there is no value, validation is
>> successful.
>> However, when I run schema validation where the tag is there but the 
>> value
>> is empty, I will get a schema validation error.  Here is an example:
>>
>> Here's the schema fragment:
>>         <element name="FOO_DATE" minOccurs="0" type="date" />
>> Here a fragment of the XML with FOO_DATE:
>>         <FOO_DATE/>
>>
>> Here is the error:
>> cvc-type.3.1.3: The value '' of element 'FOO_DATE' is not valid.
>>
>> The only way this will successfully validate is if the tag 
>> <FOO_DATE/> is
>> not in the xml document at all.
>>
>> Is this the way it is supposed to work?  It doesn't seem consistent with
>> other datatypes.
>>
>> -Mike
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
>> For additional commands, e-mail: xerces-j-user-help@xml.apache.org
>>
>
>
> .................................................................
> Ender Özgür            neofonie GmbH        Tel: +49.30.24627-329
> Softwareentwicklung    Robert-Koch-Platz 4  FAX: +49.30.24627-120
> oezguer@neofonie.de    D-10115 Berlin       Web: www.neofonie.de
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
> For additional commands, e-mail: xerces-j-user-help@xml.apache.org
>

-- 
------------------------------------------------------------------------

Maksym Kovalenko
Software Engineer
Marketswitch Corporation
http://www.marketswitch.com <http://www.marketswitch.com/>
108 Powers Court, Suite 225
Dulles, VA 20166
Phone: +1 (703) 444-6750 ext. 302
Fax: +1 (703) 444-6812