RE: xml schema validation using Xerces 2.4.0

Hi Anitha,

if minOccurs="0" is on the element "USAddress" then you are saying that
either you have the element or you don't (not that is has or has not any
children).

If your XML instance has no "USAddress" element, I suspect you will not get
a parsing error.

Colin

-----Original Message-----
From: xmlschema-dev-request@w3.org
[mailto:xmlschema-dev-request@w3.org]On Behalf Of Anitha Chandran
Sent: 12 May 2003 16:24
To: xmlschema-dev@w3.org
Subject: xml schema validation using Xerces 2.4.0



Hi,
I am doing an xml schema validation using xerces 2.4.0.

I have a complex type "USAddress" which has other child elements inside .
Now, this is optional. So sometimes, I get just the tag <USAddress/>..
without any child elemets inside.
which is valid, as per the requirements.

I have specified that USAdress is optional ( minOccurs = 0" in my schema- i
use xmlspy to create and edit schemas.
Irrespective of this, on encountering this tag, i get the following error.

[Error] POCRConvert1.xml:138:19: cvc-complex-type.2.4.b: The content of
element
'UsAddress' is not complete. One of '{"":StreetNumPrefix, "":StreetNumber,
"":St
reetNumberSuffix, "":StreetDirectional, "":StreetName}' is expected.

Can anyone let me know how ti solve this?

Thanks,
Anitha.

_________________________________________________________________
IIFA Awards. Vote now.
http://server1.msn.co.in/msnspecials/iifa2003/index.asp Celebrate Indian
cinema.

Received on Monday, 12 May 2003 12:15:26 UTC