2
我试图用引入nokogiri ruby解析器读取XSD文件和它抛出以下错误 引入nokogiri :: XML :: SyntaxError错误(元素“{http://www.w3.org/2001/XMLSchema}element”:内容((simpleType | complexType)?,(unique | key | keyref)*))。):XSD - 内容无效。
是否有人知道xsd有什么问题?
<?xml version="1.0" encoding="utf-8"?>
<xsd:schema elementFormDefault="qualified" version="1.0" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:element name="company_donation_request" type="company_donation_requestType" />
<xsd:complexType name="company_donation_requestType">
<xsd:sequence>
<xsd:element name="order" type="orderType"></xsd:element>
<xsd:element name="donation" type="donationType"></xsd:element>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="donationType">
<xsd:sequence>
<xsd:element name="campaign_key" type="xsd:string" minOccurs="1" maxOccurs="1" >
<xsd:restriction base="xsd:string">
<xsd:minLength value="2"/>
<xsd:maxLength value="255"/>
</xsd:restriction>
</xsd:element>
<xsd:element name="amount" type="xsd:decimal" minOccurs="1" maxOccurs="1" ></xsd:element>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="orderType">
<xsd:sequence>
<xsd:element name="id" type="xsd:string" minOccurs="1" maxOccurs="1" >
<xsd:restriction base="xsd:string">
<xsd:minLength value="2"/>
<xsd:maxLength value="255"/>
</xsd:restriction>
</xsd:element>
<xsd:element name="fulfillment_date" type="xsd:dateTime" minOccurs="1" maxOccurs="1" >
<xsd:restriction base="xsd:string">
<xsd:minLength value="2"/>
<xsd:maxLength value="255"/>
</xsd:restriction>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:schema>