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 Tevoi Andrea <te...@cad.it> on 2010/02/04 12:13:39 UTC

Getting error on xsi:nil attribute while validating against a Schema

Hi,

 

While validating an XML instance against its Schema I've got this
exception:

cvc-complex-type.3.2.2: Attribute 'xsi:nil' is not allowed to appear in
element 'CDIP'

 

Here is the XML istance portion:

<IN02 xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
xmlns="http://www.cadit.it/SI/SIGS534">

...

            <CDIP xsi:nil="true"/>

            ...

</IN02>

 

Here is the XML Schema portion:

...

<xsd:element name="CDIP" nillable="true" minOccurs="0">

...

 

Is it a Xerces Bug? (I use Xerces version that comes with JDK 1.5)

 

Thanks in advance

Andrea Tevoi


Re: Getting error on xsi:nil attribute while validating against a Schema

Posted by Mukul Gandhi <mu...@apache.org>.
On Thu, Feb 4, 2010 at 8:39 PM, Michael Glavassevich
<mr...@ca.ibm.com> wrote:
> There's at least one problem with your document. The namespace for xsi:nil
> is incorrect. You specified "http://www.w3.org/1999/XMLSchema-instance". It
> should be "http://www.w3.org/2001/XMLSchema-instance".

Great eyes, Michael :) I missed that.


-- 
Regards,
Mukul Gandhi

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


R: Getting error on xsi:nil attribute while validating against a Schema

Posted by Tevoi Andrea <te...@cad.it>.
Thank you Michael,

 

actually that was the problem.

 

Thanks again

Andrea

 

 

_____________________

Andrea Tevoi
CAD S.r.l.
Gruppo CAD IT
Via Torricelli 44/A
37136 Verona - Italy
Tel. +39045 82 11 111
Fax +39045 82 11 110
tevoi@cad.it
www.cadit.it
_____________________

Questo messaggio, con gli eventuali allegati, contiene informazioni riservate o confidenziali . Chiunque lo ricevesse pur non essendone il destinatario è pregato di segnalarlo immediatamente al mittente, di cancellarlo dal proprio sistema e di non copiarlo, diffonderne il contenuto o utilizzarlo in alcun modo.

This e-mail and any files transmitted with it are confidential or privileged. If you are not the intended recipient of this e-mail, please notify the sender and delete it from your system immediately: you should not copy, disclose or use either it or its attachments in any way whatsoever.



 

________________________________

Da: Michael Glavassevich [mailto:mrglavas@ca.ibm.com] 
Inviato: giovedì 4 febbraio 2010 16.10
A: j-users@xerces.apache.org
Oggetto: Re: Getting error on xsi:nil attribute while validating against a Schema

 

Hi,

There's at least one problem with your document. The namespace for xsi:nil is incorrect. You specified "http://www.w3.org/1999/XMLSchema-instance". It should be "http://www.w3.org/2001/XMLSchema-instance".

Keep in mind that what ships in JDK 1.5 is Sun's fork of the Xerces code base. It's very old now, contains code and bugs that Xerces never had and would probably have other issues that we fixed a long time ago. If you're having problems with this version you need to raise it with Sun. We have no influence over what goes in there.

Thanks.

Michael Glavassevich
XML Parser Development
IBM Toronto Lab
E-mail: mrglavas@ca.ibm.com
E-mail: mrglavas@apache.org

"Tevoi Andrea" <te...@cad.it> wrote on 02/04/2010 06:13:39 AM:

> Hi,
>  
> While validating an XML instance against its Schema I've got this exception:
> cvc-complex-type.3.2.2: Attribute 'xsi:nil' is not allowed to appear
> in element 'CDIP'
>  
> Here is the XML istance portion:
> <IN02 xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance" xmlns="
> http://www.cadit.it/SI/SIGS534">
> ...
>             <CDIP xsi:nil="true"/>
>             ...
> </IN02>
>  
> Here is the XML Schema portion:
> ...
> <xsd:element name="CDIP" nillable="true" minOccurs="0">
> ...
>  
> Is it a Xerces Bug? (I use Xerces version that comes with JDK 1.5)
>  
> Thanks in advance
> Andrea Tevoi


Re: Getting error on xsi:nil attribute while validating against a Schema

Posted by Michael Glavassevich <mr...@ca.ibm.com>.
Hi,

There's at least one problem with your document. The namespace for xsi:nil
is incorrect. You specified "http://www.w3.org/1999/XMLSchema-instance". It
should be "http://www.w3.org/2001/XMLSchema-instance".

Keep in mind that what ships in JDK 1.5 is Sun's fork of the Xerces code
base. It's very old now, contains code and bugs that Xerces never had and
would probably have other issues that we fixed a long time ago. If you're
having problems with this version you need to raise it with Sun. We have no
influence over what goes in there.

Thanks.

Michael Glavassevich
XML Parser Development
IBM Toronto Lab
E-mail: mrglavas@ca.ibm.com
E-mail: mrglavas@apache.org

"Tevoi Andrea" <te...@cad.it> wrote on 02/04/2010 06:13:39 AM:

> Hi,
>
> While validating an XML instance against its Schema I?ve got this
exception:
> cvc-complex-type.3.2.2: Attribute 'xsi:nil' is not allowed to appear
> in element 'CDIP'
>
> Here is the XML istance portion:
> <IN02 xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance" xmlns="
> http://www.cadit.it/SI/SIGS534">
> ?
>             <CDIP xsi:nil="true"/>
>             ?
> </IN02>
>
> Here is the XML Schema portion:
> ?
> <xsd:element name="CDIP" nillable="true" minOccurs="0">
> ?
>
> Is it a Xerces Bug? (I use Xerces version that comes with JDK 1.5)
>
> Thanks in advance
> Andrea Tevoi

Re: Getting error on xsi:nil attribute while validating against a Schema

Posted by Mukul Gandhi <mu...@apache.org>.
I'm not aware of any such bug with Xerces-J.

Though I suspect that, following could be an issue with your XML
schema document:

Your XML instance is in a namespace (which is,
http://www.cadit.it/SI/SIGS534). Your schema should have a
corresponding targetNamespace attribute on xs:schema instruction. [1]

Please see, if the solution [1] can fix this problem. If it doesn't,
could you please try with the newest Apache version of Xerces-J, and
report the results please.

On Thu, Feb 4, 2010 at 4:43 PM, Tevoi Andrea <te...@cad.it> wrote:
> Hi,
>
>
>
> While validating an XML instance against its Schema I’ve got this exception:
>
> cvc-complex-type.3.2.2: Attribute 'xsi:nil' is not allowed to appear in
> element 'CDIP'
>
>
>
> Here is the XML istance portion:
>
> <IN02 xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
> xmlns="http://www.cadit.it/SI/SIGS534">
>
> …
>
>             <CDIP xsi:nil="true"/>
>
>             …
>
> </IN02>
>
>
>
> Here is the XML Schema portion:
>
> …
>
> <xsd:element name="CDIP" nillable="true" minOccurs="0">
>
> …
>
>
>
> Is it a Xerces Bug? (I use Xerces version that comes with JDK 1.5)
>
>
>
> Thanks in advance
>
> Andrea Tevoi



-- 
Regards,
Mukul Gandhi

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