You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-dev@xerces.apache.org by yr...@daimlerchrysler.com on 2003/05/15 16:14:45 UTC
Pls Help cvc-complex-type.2.1:
I am getting the following error while validating the following XML against
the Schema
cvc-complex-type.2.1: Element 'cobuyerEmployer' must have no character or
element information item [children], because the types content type is
empty.
<cobuyerEmployer cob_currEmplrName="ADP" cob_currMonthsStayed="300"
cob_currOccupation="ANALYST">
</cobuyerEmployer>
<cobuyerIncome cob_primInc="25000">
</cobuyerIncome>
But when I changed the XMl to the following I am not getting any error, pls
let me know why?
<cobuyerEmployer cob_currEmplrName="ADP" cob_currMonthsStayed="300"
cob_currOccupation="ANALYST"/>
<cobuyerIncome cob_primInc="25000"/>
XML Schema
<xsd:element name = "cobuyerEmployer" type = "cobuyerEmployerType"
minOccurs = "0"/>
<xsd:complexType name = "cobuyerEmployerType">
<xsd:attribute name = "cob_currEmplrName" use = "optional">
<xsd:simpleType>
<xsd:restriction base = "xsd:string">
<xsd:maxLength value = "25"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:attribute>
<xsd:attribute name = "cob_currMonthsStayed" use = "optional" type
= "decimalNum5"/>
<xsd:attribute name = "cob_currOccupation" use = "optional">
<xsd:simpleType>
<xsd:restriction base = "xsd:string">
<xsd:maxLength value = "23"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:attribute>
</xsd:complexType>
Sincerely,
Yarram Reddy
WebACE
Tie/L:870-5968
OutsideLine:(248) 427-5968
Email:YR11@daimlerchrysler.com
Pager: 313 714 5169 or YR11-page@dcx.com
---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-dev-help@xml.apache.org
Re: Pls Help cvc-complex-type.2.1:
Posted by "K. Venugopal" <k....@sun.com>.
Since you have defined only attributes in your complextype ,i think its
not vaild to have a new line or space between start and end element.This
should work .
<cobuyerEmployer cob_currEmplrName="ADP" cob_currMonthsStayed="300"cob_currOccupation="ANALYST"></cobuyerEmployer>
Thanks
venu
yr11@daimlerchrysler.com wrote:
>I am getting the following error while validating the following XML against
>the Schema
>
>cvc-complex-type.2.1: Element 'cobuyerEmployer' must have no character or
>element information item [children], because the types content type is
>empty.
>
><cobuyerEmployer cob_currEmplrName="ADP" cob_currMonthsStayed="300"
>cob_currOccupation="ANALYST">
></cobuyerEmployer>
><cobuyerIncome cob_primInc="25000">
></cobuyerIncome>
>
>But when I changed the XMl to the following I am not getting any error, pls
>let me know why?
>
><cobuyerEmployer cob_currEmplrName="ADP" cob_currMonthsStayed="300"
>cob_currOccupation="ANALYST"/>
><cobuyerIncome cob_primInc="25000"/>
>
>
>XML Schema
>
><xsd:element name = "cobuyerEmployer" type = "cobuyerEmployerType"
>minOccurs = "0"/>
>
><xsd:complexType name = "cobuyerEmployerType">
> <xsd:attribute name = "cob_currEmplrName" use = "optional">
> <xsd:simpleType>
> <xsd:restriction base = "xsd:string">
> <xsd:maxLength value = "25"/>
> </xsd:restriction>
> </xsd:simpleType>
> </xsd:attribute>
> <xsd:attribute name = "cob_currMonthsStayed" use = "optional" type
>= "decimalNum5"/>
> <xsd:attribute name = "cob_currOccupation" use = "optional">
> <xsd:simpleType>
> <xsd:restriction base = "xsd:string">
> <xsd:maxLength value = "23"/>
> </xsd:restriction>
> </xsd:simpleType>
> </xsd:attribute>
></xsd:complexType>
>
>Sincerely,
>Yarram Reddy
>WebACE
>Tie/L:870-5968
>OutsideLine:(248) 427-5968
>Email:YR11@daimlerchrysler.com
>Pager: 313 714 5169 or YR11-page@dcx.com
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: xerces-j-dev-unsubscribe@xml.apache.org
>For additional commands, e-mail: xerces-j-dev-help@xml.apache.org
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-dev-help@xml.apache.org