[xsd-users] Namespaces

Daniel Berglund daniel.berglund at scilifelab.se
Mon Jun 18 08:59:05 EDT 2012


Hi

I am having some problems making an xsd file. I am starting to suspect
there is something wrong with the xml file but I am not sure.

The xml file looks something like this

<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="tandem-style.xsl"?>
<bioml xmlns:GAML="http://www.bioml.com/gaml/"
xmlns="test_space"> //This row is here when it works
.
.
.
.
.
GAML namespace here
<bioml>

When the parser is validating it cant find any of the elements or
attributes. If I add a namespace xmlns="test_space" to the xml and
targetnamespace="test_space" it works. So many question is if there is a
declaration for namespace missing in the xml file or am I simply missing to
write something in the xsd file? The fact that there is another
namespace(GAML) in the file makes it more complicated to I think.

The xsd file looks like this:

<?xml version="1.0"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
                     elementFormDefault="unqualified"
                     targetNamespace="test_space"    //This row is here
when it works
                     xmlns="test_space">                   //This row is
here when it works
<xsd:import  namespace="http://www.bioml.com/gaml/"
                   schemaLocation="gaml.xsd"/>

Related to GAML namespace I had trouble importing it, the error I get is
that it says that the namespace is "" and its expecting "
http://www.bioml.com/gaml/" but targetnamespace is declared in the GAML xsd
file. Any idea what the problem is?
The header in gaml.xsd

<?xml version="1.0"?>
<xsd:schema targetNamespace="http://www.bioml.com/gaml/" xmlns:xsd="
http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" xmlns="
http://www.bioml.com/gaml/">


Regards
Daniel


More information about the xsd-users mailing list