1

当我尝试验证 Amazon Marketplace Web 服务 SubmitFeed 以完成订单时,我收到以下错误:

xmllint.exe --schema OrderFulfillment.xsd OrderFulfillment.xml

OrderFulfillment.xml:2:元素 AmazonEnvelope:架构有效性错误:元素“AmazonEnvelope”:没有可用于验证根的匹配全局声明。OrderFulfillment.xml 无法验证

订单履行.xml

<?xml version="1.0" encoding="UTF-8"?>
<AmazonEnvelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="amzn-envelope.xsd">
    <Header>
        <DocumentVersion>1.01</DocumentVersion>
        <MerchantIdentifier>AXGZ4X5NTV6SN</MerchantIdentifier>
    </Header>
    <MessageType>OrderFulfillment</MessageType>
    <Message>
        <MessageID>1</MessageID>
        <OrderFulfillment>
            <AmazonOrderID>104-5894782-1841713</AmazonOrderID>
            <FulfillmentDate>2012-04-07T15:54:40.154Z</FulfillmentDate>
            <FulfillmentData>
                <CarrierCode>USPS</CarrierCode>
                <ShippingMethod>Priority</ShippingMethod>
                <ShipperTrackingNumber>9109901000372243321450</ShipperTrackingNumber>
            </FulfillmentData>
        </OrderFulfillment>
    </Message>
</AmazonEnvelope>

我究竟做错了什么?

4

1 回答 1

1

找到解决方案,您必须使用父架构进行验证,在本例中为 amzn-envelope.xsd

请参阅lxml 如何在加载内联模式的同时针对 XSD 文件验证某些 XML?

于 2012-04-13T01:08:10.857 回答