package xsdxsltcheck;

use 5.008005;
use strict;
use warnings;

require Exporter;

our @ISA = qw(Exporter);

our @EXPORT = qw(xsdcheck xsltcheck FGDC2MRFcheck xsl4mrf2fgdccheck);

our $VERSION = '0.01';

sub xsdcheck {
my $check=shift @_;
my $xsd = "/mt/apps/gpms/xsd";

if (-e "$xsd/Atlas.xsd"){
my $answer="OK";
}else{
print "$xsd/Atlas.xsd could not be found!";
exit(1);
};

if (-e "$xsd/CitationInformation.xsd"){
}else{
print "$xsd/CitationInformation.xsd";
exit(1);
};

if (-e "$xsd/ContactInformation.xsd"){
}else{
print "$xsd/DataQualityInformation.xsd could not be found!!\n";
exit(1);
};

if (-e "$xsd/DataQualityInformation.xsd"){
}else{
print "$xsd/DataQualityInformation.xsd could not be found!!\n"; 
exit(1);
};

if (-e "$xsd/DistributionInformation.xsd"){
}else{
print "$xsd/DistributionInformation.xsd could not be found!!\n";
exit(1);
};

if (-e "$xsd/Edges.xsd"){
}else{
print "$xsd/Edges.xsd!!\n";
exit(1);
};

if (-e "$xsd/EntityAndAttributeInformation.xsd"){
}else{
print "$xsd/EntityAndAttributeInformation.xsd!!\n";
exit(1);
};

if (-e "$xsd/IdentificationInformation.xsd"){
}else{
print "$xsd/IdentificationInformation.xsd could not be found!!\n";
exit(1);
};

if (-e "$xsd/Legacy.xsd"){
}else{
print "$xsd/Legacy.xsd could not be found!!\n";
exit(1);
};

if (-e "$xsd/Map.xsd"){
}else{
print "$xsd/Map.xsd could not be found!!\n";
exit(1);
};

if (-e "$xsd/MetadataReferenceInformation.xsd"){
}else{
print "$xsd/MetadataReferenceInformation.xsd could not be found!!\n";
exit(1);
};

if (-e "$xsd/MiscTypesAndGroups.xsd"){
}else{
print "$xsd/MiscTypesAndGroups.xsd could not be found!!\n";
exit(1);
};

if (-e "$xsd/Planned.xsd"){
}else{
print "$xsd/Planned.xsd could not be found!!\n";
exit(1);
};

if (-e "$xsd/SpatialDataOrganizationInformation.xsd"){
}else{
print "$xsd/SpatialDataOrganizationInformation.xsd could not be found!!\n";
exit(1);
};

if (-e "$xsd/SpatialReferenceInformation.xsd"){
}else{
print "$xsd/SpatialReferenceInformation.xsd could not be found!!\n";
exit(1);
};

if (-e "$xsd/Tabular.xsd"){
}else{
print "$xsd/Tabular.xsd could not be found!!\n";
exit(1);
};

if (-e "$xsd/Vector.xsd"){
}else{
print "$xsd/Vector.xsd could not be found!!\n";
exit(1);
};

#};

};



sub xsltcheck{

my $xslt ="/mt/apps/gpms/xsl";
my $checkxslt=shift @_;

if (-e "$xslt/DataQualityInformation.xsl"){
}else{
print "$xslt/DataQualityInformation.xsl could not be found!!\n";
exit(1);
};

if (-e "$xslt/DistributionInformation.xsl"){
}else{
print "$xslt/DistributionInformation.xsl could not be found!!\n";
exit(1);
};

if (-e "$xslt/EntityAndAttributeInformation.xsl"){
}else{
print "$xslt/EntityAndAttributeInformation.xsl could not be found!!\n";
exit(1);
};

if (-e "$xslt/IdentificationInformation.xsl"){
}else{
print "$xslt/IdentificationInformation.xsl could not be found!!\n";
exit(1);
};

if (-e "$xslt/MetadataReferenceInformation.xsl"){
}else{
print "$xslt/MetadataReferenceInformation.xsl  could not be found!!\n";
exit(1);
};

if (-e "$xslt/MIF2MRF.xsl"){
}else{
print "$xslt/MIF2MRF.xsl could not be found!!\n";
exit(1);
};

if (-e "$xslt/SpatialDataOrganizationInformation.xsl"){
}else{
print "$xslt/SpatialDataOrganizationInformation.xsl could not be found!!\n";
exit(1);
};

if (-e "$xslt/SpatialReferenceInformation.xsl"){
}else{
print "$xslt/SpatialReferenceInformation.xsl could not be found!!\n";
exit(1);
};


};


sub FGDC2MRFcheck {
my $FGDC2MRF = "/mt/apps/gpms/FGDC2MRF";

if (-e "$FGDC2MRF/01_idinfo_planned.xsl"){
}else{
print "$FGDC2MRF/01_idinfo_planned.xsl could not be found!!\n";
exit(1);
};

if (-e "$FGDC2MRF/01_idinfo.xsl"){
}else{
print "$FGDC2MRF/01_idinfo.xsl could not be found!!\n";
exit(1);
};

if (-e "$FGDC2MRF/02_dataqual_map.xsl"){
}else{
print "$FGDC2MRF/02_dataqual_map.xsl could not be found!!\n";
exit(1);
};

if (-e "$FGDC2MRF/02_dataqual_tab.xsl"){
}else{
print "$FGDC2MRF/02_dataqual_tab.xsl could not be found!!\n";
exit(1);
};

if (-e "$FGDC2MRF/02_dataqual.xsl"){
}else{
print "$FGDC2MRF/02_dataqual.xsl could not be found!!\n";
exit(1);
};

if (-e "$FGDC2MRF/03_spdoinfo.xsl"){
}else{
print "$FGDC2MRF/03_spdoinfo.xsl could not be found!!\n";
exit(1);
};

if (-e "$FGDC2MRF/04_spref.xsl"){
}else{
print "$FGDC2MRF/04_spref.xsl could not be found!!\n";
exit(1);
};


if (-e "$FGDC2MRF/05_eainfo.xsl"){
}else{
print "$FGDC2MRF/05_eainfo.xsl could not be found!!\n";
exit(1);
};

if (-e "$FGDC2MRF/06_distinfo.xsl"){
}else{
print "$FGDC2MRF/06_distinfo.xsl could not be found!!\n";
exit(1);
};

if (-e "$FGDC2MRF/07_metainfo.xsl"){
}else{
print "$FGDC2MRF/07_metainfo.xsl could not be found!!\n";
exit(1);
};

if (-e "$FGDC2MRF/FGDC2mif_atlas.xsl"){
}else{
print "$FGDC2MRF/FGDC2mif_atlas.xsl could not be found!!\n";
exit(1);
};

if (-e "$FGDC2MRF/FGDC2mif_edges.xsl"){
}else{
print "$FGDC2MRF/FGDC2mif_edges.xsl  could not be found!!\n";
exit(1);
};

if (-e "$FGDC2MRF/FGDC2mif_legacy.xsl"){
}else{
print "$FGDC2MRF/FGDC2mif_legacy.xsl could not be found!!\n";
exit(1);
};

if (-e "$FGDC2MRF/FGDC2mif_map.xsl"){
}else{
print "$FGDC2MRF/FGDC2mif_map.xsl could not be found!!\n";
exit(1);
};

if (-e "$FGDC2MRF/FGDC2mif_planned.xsl"){
}else{
print "$FGDC2MRF/FGDC2mif_planned.xsl could not be found!!\n";
exit(1);
};

if (-e "$FGDC2MRF/FGDC2mif_tabular.xsl"){
}else{
print "$FGDC2MRF/FGDC2mif_tabular.xsl could not be found!!\n";
exit(1);
};

if (-e "$FGDC2MRF/FGDC2mif_vector.xsl"){
}else{
print "$FGDC2MRF/FGDC2mif_vector.xsl  could not be found!!\n";
exit(1);
};

if (-e "$FGDC2MRF/FGDC2mif.xsl"){
}else{
print "$FGDC2MRF/FGDC2mif.xsl could not be found!!\n";
exit(1);
};

 
 
}; 

sub xsl4mrf2fgdccheck{
my $xsl4mrf2fgdc= "/mt/apps/gpms/xsl/xsl4mrf2fgdc";

if (-e "$xsl4mrf2fgdc/01_Identification_Information.xsl"){
}else{
print "$xsl4mrf2fgdc/01_Identification_Information.xsl could not be found!!\n";
exit(1);
};


if (-e "$xsl4mrf2fgdc/02_Data_Quality_Information.xsl"){
}else{
print "$xsl4mrf2fgdc/02_Data_Quality_Information.xsl could not be found!!\n";
exit(1);
};

if (-e "$xsl4mrf2fgdc/03_Spatial_Data_Organization_Information.xsl"){
}else{
print "$xsl4mrf2fgdc/03_Spatial_Data_Organization_Information.xsl could not be found!!\n";
exit(1);
};

if (-e "$xsl4mrf2fgdc/04_Spatial_Reference_Information.xsl"){
}else{
print "$xsl4mrf2fgdc/04_Spatial_Reference_Information.xsl could not be found!!\n";
exit(1);
};

if (-e "$xsl4mrf2fgdc/05_Entity_And_Attribute_Information.xsl"){
}else{
print "$xsl4mrf2fgdc/05_Entity_And_Attribute_Information.xsl could not be found!!\n";
exit(1);
};

if (-e "$xsl4mrf2fgdc/06_Distribution_Information.xsl"){
}else{
print "$xsl4mrf2fgdc/06_Distribution_Information.xsl could not be found!!\n";
exit(1);
};

if (-e "$xsl4mrf2fgdc/07_Metadata_Reference_Information.xsl"){
}else{
print "$xsl4mrf2fgdc/07_Metadata_Reference_Information.xsl could not be found!!\n";
exit(1);
};

if (-e "$xsl4mrf2fgdc/MRF2FGDC.xsl"){
}else{
print "$xsl4mrf2fgdc/MRF2FGDC.xsl could not be found!!\n";
exit(1);
};


};
