使用不正确的 url 验证 jdoconfig

2022-01-09 00:00:00 xml xsd java jdo

我正在使用 jdo 并使用 jdoconfig.xml 配置持久性管理器

I am using jdo and configuring the persistence manager with jdoconfig.xml

但是,无论我在哪里找到有关 jdoconfig.xml 的文档,它都指出 http://java.sun.com/xml/ns/jdo/jdoconfig 应该用于验证.

However everywhere I find documentation about jdoconfig.xml it states that http://java.sun.com/xml/ns/jdo/jdoconfig should be used for validation.

<jdoconfig xmlns="http://java.sun.com/xml/ns/jdo/jdoconfig"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:noNamespaceSchemaLocation="http://java.sun.com/xml/ns/jdo/jdoconfig">
etc

这个 url 指向一个不存在的文件,我的 xml 验证器报告了一个错误.甚至使用它的目的是什么,我们是否可以相信 url 不会改变并且我们所有的 xml 文件突然停止验证?

This url points to a nonexistent file and my xml validator reports an error. What is the purpose of even using this, can we ever trust that the urls will not change and all our xml files all of a sudden stops validating?

有人知道新网址吗?

推荐答案

xmlns 不是真正的文件/目录,更多的是命名空间,所以不应该存在!附加版本以获得真正的XSD文件,即http://java.sun.com/xml/ns/jdo/jdoconfig_3_0.xsd

The xmlns is not a real file/directory, more a namespace, so ought not exist! The version is appended to get the real XSD file, namely http://java.sun.com/xml/ns/jdo/jdoconfig_3_0.xsd

也许

<jdoconfig xmlns="http://java.sun.com/xml/ns/jdo/jdoconfig"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/jdo/jdoconfig http://java.sun.com/xml/ns/jdo/jdoconfig_3_0.xsd">

相关文章