[英]SAXParseException creating an Enum in XSD
我在構建我的第一個 XSD 文件時遇到問題。 我正在嘗試使用jaxb2-maven-plugin
在我的 XSD 上生成 Java POJO 的基礎。
這是我的xsd
文件:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<xs:schema version="1.0"
xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name = "Tshirt">
<xs:complexType>
<xs:sequence>
<xs:element name = "Color" type = "clothesColorType" />
<xs:element name = "Size" type = "clothesSizeType" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:simpleType name="clothesSizeType">
<xs:restriction base="xs:string">
<xs:enumeration value="S" />
<xs:enumeration value="M" />
<xs:enumeration value="L" />
<xs:enumeration value="XL" />
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="clothesColorType">
<xs:restriction base="xs:string">
<xs:enumeration value="Black" />
<xs:enumeration value="White" />
<xs:enumeration value="Green" />
<xs:enumeration value="Blue" />
</xs:restriction>
</xs:simpleType>
</xs:schema>
當我的插件嘗試解析文件時,出現錯誤
org.xml.sax.SAXParseException; systemId: file:/ruta/src/main/resources/wsdl-definition/Assurance.xsd; lineNumber: 47; columnNumber: 72; src-resolve: No se puede resolver el nombre 'clothesColorType' para un componente 'type definition'.
我已經用谷歌搜索了幾個小時,但我沒有找到回應。 有任何想法嗎?
先感謝您。
模式有效(撒克遜人接受它,所以它必須是......)
因此,問題在於您的模式處理器,或者您調用它的方式。
我注意到您的架構沒有 47 行,因此我懷疑您實際使用的文件與顯示的文件不同。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.