XML File with local copy of XML Schema(具有 XML Schema 本地副本的 XML 文件)
问题描述
我正在尝试一些 XML Schema 示例,并且必须使用示例 XML 文件对其进行验证.架构是一个本地文件 (someFile.xsd).我正在使用 eclipse 并希望在 XML 文件中包含一个引用以指向此本地 xsd 文件,以便 eclipse 可以向我建议元素.
I am trying out some XML Schema examples and have to validate them with a sample XML File. The schema is a local file (someFile.xsd). I am using eclipse and want to include a reference in the XML file to point to this local xsd file so that eclipse can suggest the elements to me.
我发现很难想出包含本地文件的语法.有什么建议吗?
Am finding it hard to come up with the syntax to include a local file. Any suggestions ?
推荐答案
你使用的是 xsi:schemaLocation
属性?
Are you using the xsi:schemaLocation
attribute?
例如:
<?xml version="1.0" encoding="UTF-8"?>
<root xmlns="http://foo/target/Namespace"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:someNamespace="someFile"
xsi:schemaLocation="
someFile someFile.xsd" >
...
</root>
我相信 someFile.xsd
必须在你的类路径中
I believe someFile.xsd
has to be in your classpath
这篇关于具有 XML Schema 本地副本的 XML 文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:具有 XML Schema 本地副本的 XML 文件


- Eclipse 插件更新错误日志在哪里? 2022-01-01
- 如何使用WebFilter实现授权头检查 2022-01-01
- 将log4j 1.2配置转换为log4j 2配置 2022-01-01
- Java包名称中单词分隔符的约定是什么? 2022-01-01
- Spring Boot连接到使用仲裁器运行的MongoDB副本集 2022-01-01
- 从 finally 块返回时 Java 的奇怪行为 2022-01-01
- C++ 和 Java 进程之间的共享内存 2022-01-01
- Safepoint+stats 日志,输出 JDK12 中没有 vmop 操作 2022-01-01
- value & 是什么意思?0xff 在 Java 中做什么? 2022-01-01
- Jersey REST 客户端:发布多部分数据 2022-01-01