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 Ragunath Marudhachalam <rm...@circuitvision.com> on 2004/03/22 23:33:06 UTC

Problem in schema Validation. (urgent plz)

All,

I defined an element in the schema as type integer (like as follows)

		<xs:element name="ver" type="xs:integer"/>.

I have the minoccurance as 0 and maxoccurance as 1.

But when i have an element with no value, and i try to validate using xerces
parser, i get the following error.


line #53: org.xml.sax.SAXParseException: cvc-datatype-valid.1.2.1: '' is not
a v
alid value for 'integer'.
line #53: org.xml.sax.SAXParseException: cvc-type.3.1.3: The value '' of
element
 'nor' is not valid.

But if i validate in XmlSpy, it gets validated.

Please help me where i'm wrong.

Ragu
CircuitVision



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


RE: Problem in schema Validation. (urgent plz)

Posted by Neil Delima <nd...@ca.ibm.com>.



Hi Ragu,

If you did not, you would need to specify the
http://www.w3.org/2001/XMLSchema-instance:nil="true" attribute on the
element ("ver") in your instance document.

Thanks,
Neil.



"Ragunath Marudhachalam" <rm...@circuitvision.com> wrote on
03/22/2004 06:20:58 PM:

> Hi Elena,
>
> Thank you very much for ur help.
>
> You said "The lexical space [2] of
> integer  [3] does not permit empty space.". You mean i cant have a empty
tag
> for integer datatype??
>
> I tried using nillable to true... But i'm still getting the same error...
>
> It would be of great help if you could clarify this.
>
> Thanks
>
> Ragu
> CircuitVision
>
>
>
> -----Original Message-----
> From: Elena Litani [mailto:elitani@ca.ibm.com]
> Sent: Monday, March 22, 2004 5:51 PM
> To: xerces-j-user@xml.apache.org
> Subject: Re: Problem in schema Validation. (urgent plz)
>
>
>
>
>
>
> You must declare your element to be nillable [1]. The lexical space [2]
of
> integer  [3] does not permit empty space.
>
>
> [1] http://www.w3.org/TR/xmlschema-1/#nillable
> [2] http://www.w3.org/TR/xmlschema-2#cvc-datatype-valid
> [3] http://www.w3.org/TR/xmlschema-2/#integer
>
> Thanks,
> --
> Elena Litani / IBM Toronto
>
> "Ragunath Marudhachalam" <rm...@circuitvision.com> wrote on
> 03/22/2004 05:33:06 PM:
>
> > All,
> >
> > I defined an element in the schema as type integer (like as follows)
> >
> >       <xs:element name="ver" type="xs:integer"/>.
> >
> > I have the minoccurance as 0 and maxoccurance as 1.
> >
> > But when i have an element with no value, and i try to validate using
> xerces
> > parser, i get the following error.
> >
> >
> > line #53: org.xml.sax.SAXParseException: cvc-datatype-valid.1.2.1: ''
is
> not
> > a v
> > alid value for 'integer'.
> > line #53: org.xml.sax.SAXParseException: cvc-type.3.1.3: The value ''
of
> > element
> >  'nor' is not valid.
> >
> > But if i validate in XmlSpy, it gets validated.
> >
> > Please help me where i'm wrong.
> >
> > Ragu
> > CircuitVision
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
> > For additional commands, e-mail: xerces-j-user-help@xml.apache.org
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
> For additional commands, e-mail: xerces-j-user-help@xml.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
> For additional commands, e-mail: xerces-j-user-help@xml.apache.org
>


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


RE: Problem in schema Validation. (urgent plz)

Posted by Ragunath Marudhachalam <rm...@circuitvision.com>.
Hi Elena,

Thank you very much for ur help.

You said "The lexical space [2] of
integer  [3] does not permit empty space.". You mean i cant have a empty tag
for integer datatype??

I tried using nillable to true... But i'm still getting the same error...

It would be of great help if you could clarify this.

Thanks

Ragu
CircuitVision



-----Original Message-----
From: Elena Litani [mailto:elitani@ca.ibm.com]
Sent: Monday, March 22, 2004 5:51 PM
To: xerces-j-user@xml.apache.org
Subject: Re: Problem in schema Validation. (urgent plz)






You must declare your element to be nillable [1]. The lexical space [2] of
integer  [3] does not permit empty space.


[1] http://www.w3.org/TR/xmlschema-1/#nillable
[2] http://www.w3.org/TR/xmlschema-2#cvc-datatype-valid
[3] http://www.w3.org/TR/xmlschema-2/#integer

Thanks,
--
Elena Litani / IBM Toronto

"Ragunath Marudhachalam" <rm...@circuitvision.com> wrote on
03/22/2004 05:33:06 PM:

> All,
>
> I defined an element in the schema as type integer (like as follows)
>
>       <xs:element name="ver" type="xs:integer"/>.
>
> I have the minoccurance as 0 and maxoccurance as 1.
>
> But when i have an element with no value, and i try to validate using
xerces
> parser, i get the following error.
>
>
> line #53: org.xml.sax.SAXParseException: cvc-datatype-valid.1.2.1: '' is
not
> a v
> alid value for 'integer'.
> line #53: org.xml.sax.SAXParseException: cvc-type.3.1.3: The value '' of
> element
>  'nor' is not valid.
>
> But if i validate in XmlSpy, it gets validated.
>
> Please help me where i'm wrong.
>
> Ragu
> CircuitVision
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
> For additional commands, e-mail: xerces-j-user-help@xml.apache.org
>


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


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


Re: Problem in schema Validation. (urgent plz)

Posted by Elena Litani <el...@ca.ibm.com>.



You must declare your element to be nillable [1]. The lexical space [2] of
integer  [3] does not permit empty space.


[1] http://www.w3.org/TR/xmlschema-1/#nillable
[2] http://www.w3.org/TR/xmlschema-2#cvc-datatype-valid
[3] http://www.w3.org/TR/xmlschema-2/#integer

Thanks,
--
Elena Litani / IBM Toronto

"Ragunath Marudhachalam" <rm...@circuitvision.com> wrote on
03/22/2004 05:33:06 PM:

> All,
>
> I defined an element in the schema as type integer (like as follows)
>
>       <xs:element name="ver" type="xs:integer"/>.
>
> I have the minoccurance as 0 and maxoccurance as 1.
>
> But when i have an element with no value, and i try to validate using
xerces
> parser, i get the following error.
>
>
> line #53: org.xml.sax.SAXParseException: cvc-datatype-valid.1.2.1: '' is
not
> a v
> alid value for 'integer'.
> line #53: org.xml.sax.SAXParseException: cvc-type.3.1.3: The value '' of
> element
>  'nor' is not valid.
>
> But if i validate in XmlSpy, it gets validated.
>
> Please help me where i'm wrong.
>
> Ragu
> CircuitVision
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
> For additional commands, e-mail: xerces-j-user-help@xml.apache.org
>


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