xml validation error, global elements and namespace



I have the following document:



<?xml version="1.0" encoding="UTF-8"?>
<Earth_Explorer_File>
<Earth_Explorer_Header>
<Fixed_Header>
<File_Name>S2A_OPER_SRA_BANSEG_PDMC_20140825T152937_V20140101T120000_20140331T120000</File_Name>
<File_Description>X-Band Banned Segments</File_Description>
<Notes/>
<Mission>Sentinel-2A</Mission>
<File_Class>OPER</File_Class>
<File_Type>BANSEG</File_Type>
<Validity_Period>
<Validity_Start>UTC=2014-01-01T12:00:00</Validity_Start>
<Validity_Stop>UTC=2014-03-31T12:00:00</Validity_Stop>
</Validity_Period>
<File_Version>0001</File_Version>
<Reference_File>S2_TEST_MPLAORBSCT_20120627T223001_99999999T999999_0001.EEF</Reference_File>
<Source>
<System>PDMC</System>
<Creator>admin</Creator>
<Creator_Version>0001</Creator_Version>
<Creation_Date>UTC=2014-08-25T15:29:37</Creation_Date>
</Source>
</Fixed_Header>
</Earth_Explorer_Header>
<Data_Block type="xml">
<List_of_X-Band_Banned_Segments count="0"/>
</Data_Block>
</Earth_Explorer_File>


and the following xsd:



<?xml version="1.0" encoding="UTF-8"?>
<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://ift.tt/tphNwY" targetNamespace="http://ift.tt/1zPJIc3" xmlns="http://ift.tt/1zPJIc3">
<xs:include schemaLocation="http://ift.tt/1zPJIc6" />
<xs:element name="Earth_Explorer_File">
<xs:complexType>
<xs:sequence>
<xs:element name="Earth_Explorer_Header">
<xs:complexType>
<xs:sequence>
<xs:element name="Fixed_Header">
<xs:complexType>
<xs:sequence>
<xs:element name="File_Name">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:pattern value="([A-Z0-9_]){3}_([A-Z0-9_]){4}_GSUNAV_([A-Z0-9_]){1,41}"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element type="xs:string" name="File_Description"/>
<xs:element type="xs:string" name="Notes"/>
<xs:element type="xs:string" name="Mission"/>
<xs:element type="xs:string" name="File_Class"/>
<xs:element type="xs:string" name="File_Type"/>
<xs:element name="Validity_Period">
<xs:complexType>
<xs:sequence>
<xs:element type="UTC_Date_Time_Type" name="Validity_Start"/>
<xs:element type="UTC_Date_Time_Type" name="Validity_Stop"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element type="xs:byte" name="File_Version"/>
<xs:element type="xs:string" name="Reference_File"/>
<xs:element name="Source">
<xs:complexType>
<xs:sequence>
<xs:element type="xs:string" name="System"/>
<xs:element type="xs:string" name="Creator"/>
<xs:element type="xs:byte" name="Creator_Version"/>
<xs:element type="UTC_Date_Time_Type" name="Creation_Date"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Data_Block">
<xs:complexType>
<xs:sequence>
<xs:element name="List_of_X-Band_Banned_Segments">
<xs:complexType>
<xs:sequence>
<xs:element name="X-Band_Banned_Segment" maxOccurs="unbounded" minOccurs="0">
<xs:complexType>
<xs:sequence>
<xs:element type="UTC_Date_Time_Type" name="Banned_start_UTC"/>
<xs:element type="xs:long" name="Banned_start_absolute_orbit"/>
<xs:element type="UTC_Date_Time_Type" name="Banned_end_UTC"/>
<xs:element type="xs:long" name="Banned_end_absolute_orbit"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attribute type="xs:long" name="count"/>
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attribute type="xs:string" name="type"/>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>

</xs:schema>


I'm trying to validate my document against it but I get the following error: ERROR: Element 'Earth_Explorer_File': No matching global declaration available for the validation root.


I think is a very stupid thing to solve but it's about an hour and I can't get rid of it. What I'm doing wrong?


thank you.


No comments:

Post a Comment