使用 XML 编辑器解析 DTD
我正在尝试通过阅读 W3schools 来学习 XML。我已经阅读了 DTD 章节,但我想尝试那里的示例。
通过在 SO 的搜索,我发现了这个名为 Greg XML Editor 的免费工具 XML 编辑器
我的问题是,当我尝试在 xml 文件中包含文档类型声明。它说“验证错误:出于安全原因,此 XML 文档中禁止 DTD。要启用 DTD 处理,请将 XmlReaderSettings 上的 ProhibitDtd 属性设置为 false,并将设置传递到 XmlReader.Create 方法。”
试图理解 DTD 是如何工作的,但我似乎可以使用这个工具来测试这个概念。知道如何解决这个问题吗?是否有另一个免费的 xml 编辑器可以用来处理 DTD 验证?
我还没有完成 XSL/XSD 部分,但我打赌也需要一个编辑器或解析器。
谢谢。
I am trying to learn XML by reading from W3schools. I am already at the DTD chapter but I would like to try the samples there.
Thru search here at SO, I found out regarding this free tool XML editor called Greg XML Editor
My problem is that when I tried to include the Document Type Declaration at the xml file. It is saying "Validation ERROR: For security reasons DTD is prohibited in this XML document. To enable DTD processing set the ProhibitDtd property on XmlReaderSettings to false and pass the settings into XmlReader.Create method."
I am trying to understand how DTD works but I can seem to test the concept using this tool. Any idea how to fix this and if there's another xml editor that is free that I can use to handle validation on DTD?
I havent gone thru the XSL/XSD part yet but I am betting that there is a need for an editor or parser for that also.
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这表明该软件的作者已禁用 DTD 处理。我从网站上注意到它提到了 XSD 验证,但没有提到 DTD 验证。我假设您处于 Windows 环境中,因为它是一个 .NET 应用程序。
您可以尝试使用 XMLMind Editor 的个人版。这绝对支持 DTD 验证。 XMLMind Editor 是 java 应用程序,因此肯定可以在您的环境中工作,并且具有免费的优点,而 XMLSpy 的价格约为 400 美元 iirc。
That indicates that the author of the software has disabled DTD processing. I notice from the website that it mentions XSD validation but not DTD validation. I assume that you are in a Windows environment as it's a .NET application.
You could try using something like the Personal Edition of the XMLMind Editor. That definitely supports DTD validation. XMLMind Editor is java app so will definitely work in your environment and has the advantage of being free whilst XMLSpy is around $400 iirc.
Liquid XML Studo 有一个 DTD 编辑器,提供语法突出显示和验证的廉价版本大约是99美元。
Liquid XML Studo has a DTD Editor that provides syntax highlighting and validation the cheap version is about $99.