【问题标题】:The Prefix "xsi" For Attribute "xsi:schemaLocation" Associated With An Element Type "store-inventory" Is Not Bound与元素类型“store-inventory”关联的属性“xsi:schemaLocation”的前缀“xsi”未绑定
【发布时间】:2016-09-23 17:35:26
【问题描述】:

我对 xml 处理的了解非常少,因为我最熟悉 json。

目前我有 2 个文件,一个是架构定义,另一个是 xml 文件。

  1. https://seller.marketplace.sears.com/SellerPortal/s/schema/rest/inventory/import/v7/store-inventory.xsd?view=markup
  2. https://seller.marketplace.sears.com/SellerPortal/s/schema/samples/rest/inventory/import/v7/store-inventory.xml?view=markup

当我尝试使用站点 (http://www.freeformatter.com/xml-validator-xsd.html) 使用 xsd 验证 xml 时,出现了一种奇怪的行为。

当我将直接 web url(xml & xsd 文件 ulr) 放入 textfields 时,它通过了验证。

但是当我在文本区域中复制粘贴相同的内容时,出现以下错误。

The Prefix "xsi" For Attribute "xsi:schemaLocation" Associated With An Element Type "store-inventory" Is Not Bound.

我在进行 api 调用时也从服务器收到相同的错误。 任何帮助将不胜感激。

【问题讨论】:

    标签: xml xsd xml-parsing xml-namespaces


    【解决方案1】:

    您的 XML 对您的 XSD 有效。

    • 我已使用基于 Xerces-J 的离线验证器确认有效性 非常可靠。
    • 我还使用在线表格确认了有效性,网址为 http://www.freeformatter.com/xml-validator-xsd.html 使用 复制并粘贴 XML 和 XSD 字符串。我没有收到你的错误 引用。
    • 您引用的错误通常表明 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 已声明 正确,但您实际上已正确声明它。

    虽然这并不能解释你看到了什么,但希望它会鼓励你重试并克服你之前可能犯的任何错误。

    【讨论】:

      猜你喜欢
      • 2016-10-12
      • 2018-09-12
      • 2020-04-05
      • 2015-06-14
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-03-05
      相关资源
      最近更新 更多