【发布时间】:2019-12-12 14:27:27
【问题描述】:
我正在尝试为以下 XML 文档创建 XML 模式。 https://www.nationalbanken.dk/_vti_bin/DN/DataService.svc/CurrencyRatesHistoryXML?lang=en
- 作为起点,我尝试根据 w3 学校的指南创建一个非常基本的 XML 模式。
https://www.w3schools.com/xml/schema_schema.asp
这导致了这个 - 非常基本的起点。
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.gesmes.org/xml/2002-08-01" targetNamespace="http://www.ecb.int/vocabulary/2002-08-01/eurofxref" xmlns="http://www.ecb.int/vocabulary/2002-08-01/eurofxref" elementFormDefault="qualified">
<xs:element name="Envelope">
</xs:element>
</xs:schema>
- 然后我将 gesmes:schemaLocation 属性添加到原始 XML 文档的根节点。
<gesmes:Envelope
xmlns="http://www.ecb.int/vocabulary/2002-08-01/eurofxref"
xmlns:gesmes="http://www.gesmes.org/xml/2002-08-01"
gesmes:schemaLocation="http://www.ecb.int/vocabulary/2002-08-01/eurofxref ..\StockDownloadResources\CurrenciesDownloadMANUAL.XSD">
- 然后我已将 XML 工具插件安装到我的 Notepad++ 中,并尝试根据基本模式验证 XML 文档。
验证导致以下错误: 架构文件解析期间发生以下错误:XML 文档“\CurrenciesDownloadMANUAL.XSD”不是架构文档。
我错过了什么?
【问题讨论】: