XJC schema parsing error- cannot resolve name to an element declaration

StackOverflow https://stackoverflow.com/questions/17936812

  •  04-06-2022
  •  | 
  •  

Attempting to parse this schema definition:

<xsd:element name="GameManifest" type="GameSystemManifest"/>

<xsd:complexType name="entry">
    <xsd:sequence>
        <xsd:element name="SystemName" type="xsd:string"></xsd:element>
        <xsd:element name="FileLocation" type= "xsd:string"></xsd:element>
    </xsd:sequence>
</xsd:complexType>

<xsd:complexType name="GameSystemManifest">
    <xsd:sequence>
        <xsd:element ref="entry"/> <--Error message says problem line is is here.
    </xsd:sequence>
</xsd:complexType>

</xsd:schema>

with XJC nets me this error:

src-resolve: Cannot resolve the name 'entry' to a(n) 'element declaration' component.

I've got no clue what is wrong here.

Edit: Solved this myself after I read this: http://alsdias.blogspot.com/2012/11/cannot-resolve-name-to-type-definition.html

I changed the definition of "GameSystemManifest" so that "entry" is defined inside of it.

有帮助吗?

解决方案

you have to declare an element named entry. You have the complex type declared but not the element.

Declare:

<xsd:element name="entry" type="entry"/>
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top