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