Re: Help : Blank XML tags inside another Blank XML Tag : Getting error msg

Hi Neill,

> The problem is that I get the error message Unexpected child element
> 'AAADataLines'.

This error arises when your instance document (XML file) contains an
element calls 'AAADataLines', but the content model of the type of its
parent element does not contain a reference to or declaration of an
element called 'AAADataLines'.

In your case, the AAADataLines element occurs within an AAADataSheet
element, within a AAADataSheets element. The element declaration for
the AAADataSheet element in your schema looks like:

<xsd:element name="AAADataSheet" minOccurs="0" maxOccurs="unbounded">
  <xsd:complexType>
    <xsd:sequence>
      <xsd:element name="Sheet_Number" type="AAAClaims:SheetNumberType"/>
      <xsd:element name="Country" type="AAAClaims:CountryType"/>
      <xsd:element name="LFA_NLFA_IND">...</xsd:element>
    </xsd:sequence>
  </xsd:complexType>
</xsd:element>

In other words, the schema states that the AAADataSheet element
contains a Sheet_Number element, followed by a Country element,
followed by a LFA_NLFA_IND element. It does not say that it contains
an AAADataLines element. In the instance, the AAADataSheet element
contains an AAADataLines element. Therefore the instance is not valid
according to the schema.

Assuming that you want to retain the AAADataLines element in the
instance document, you must change the schema so that the content
model of the complex type definition for the AAADataSheet element
contains a particle that refers to the global declaration for the
AAADataLines element, as follows:

<xsd:element name="AAADataSheet" minOccurs="0" maxOccurs="unbounded">
  <xsd:complexType>
    <xsd:sequence>
      <xsd:element name="Sheet_Number" type="AAAClaims:SheetNumberType"/>
      <xsd:element name="Country" type="AAAClaims:CountryType"/>
      <xsd:element name="LFA_NLFA_IND">...</xsd:element>
      <xsd:element ref="AAADataLines" />
    </xsd:sequence>
  </xsd:complexType>
</xsd:element>

I hope that helps,

Jeni

---
Jeni Tennison
http://www.jenitennison.com/

Received on Saturday, 9 February 2002 06:15:07 UTC