Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Validating jdoconfig with incorrect url

Tags:

java

xml

xsd

jdo

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

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

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?

Does anyone know the new url?

like image 884
jontro Avatar asked May 18 '11 09:05

jontro


2 Answers

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

Maybe

<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">
like image 161
DataNucleus Avatar answered Oct 04 '22 23:10

DataNucleus


Just replace

xsi:noNamespaceSchemaLocation="http://java.sun.com/xml/ns/jdo/jdoconfig">

with

xsi:schemaLocation="http://java.sun.com/xml/ns/jdo/jdoconfig http://java.sun.com/xml/ns/jdo/jdoconfig_3_0.xsd"
like image 31
gianm4rco Avatar answered Oct 04 '22 22:10

gianm4rco