gpt4 book ai didi

c# - 如何从 xml 引用 xsd 文件

转载 作者:太空宇宙 更新时间:2023-11-03 16:00:32 26 4
gpt4 key购买 nike

1) pls.xsd 文件

我在同一文件夹的 xml.xsd 中包含了 pls.xsd

<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<!-- Externals changed by QTAssistant (http://www.paschidev.com) -->

<!--
This is a draft schema for the XML language defined in the
Pronunciation Lexicon Specification
(latest version at <http://www.w3.org/TR/pronunciation-lexicon/>)
At the time of writing, the specification as well as this schema are
subject to change, and no guarantee is made on their accuracy or the fact
that they are in sync.
Last modified: $Date: 2007/12/11 12:08:40 $

Copyright û 2006 World Wide Web Consortium, (Massachusetts Institute
of Technology, ERCIM, Keio University). All Rights Reserved. See
http://www.w3.org/Consortium/Legal/.
-->
<xs:schema
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:p="http://www.w3.org/2005/01/pronunciation-lexicon"
targetNamespace="http://www.w3.org/2005/01/pronunciation-lexicon"
elementFormDefault="qualified" version="1.0">
<xs:annotation>
<xs:documentation>Importing dependent namespaces</xs:documentation>
</xs:annotation>
<xs:import namespace="http://www.w3.org/XML/1998/namespace" schemaLocation="xml.xsd" />

...
</xs:schema>

2)我的XML文件我从这个文件中引用 pls.xsd

<?xml version="1.0" encoding="utf-8"?> 
<lexicon version="1.0"
xmlns="http://www.w3.org/2005/01/pronunciation-lexicon"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.w3.org/2005/01/pronunciation-lexicon
file://C:/xsdforproject/pls.xsd"
alphabet="x-microsoft-ups" xml:lang="en-IN">
<lexeme>

</lexeme>
</lexicon>

我有以上两个代码,这些代码在我的 XML 和我的 pls.xsd 文件中都出现了错误,打开外部“DTD”时发生错误

我正在使用“Visual Studio 2010”。

如何解决这个问题?

最佳答案

您正在使用的内容似乎引用了 XMLSchema.dtd,那么您是否尝试下载它并将其放在您的 xsdforproject 文件夹中?

http://www.w3.org/2009/XMLSchema/XMLSchema.dtd

关于c# - 如何从 xml 引用 xsd 文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21657347/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com