#!/usr/bin/perl
# begin_generated_IBM_copyright_prolog                             
#                                                                  
# This is an automatically generated copyright prolog.             
# After initializing,  DO NOT MODIFY OR MOVE                       
# **************************************************************** 
# Licensed Materials - Property of IBM                             
# 5724-Y95                                                         
# (C) Copyright IBM Corp.  2010, 2014    All Rights Reserved.      
# US Government Users Restricted Rights - Use, duplication or      
# disclosure restricted by GSA ADP Schedule Contract with          
# IBM Corp.                                                        
#                                                                  
# end_generated_IBM_copyright_prolog                               

use strict;
use warnings;
use Getopt::Std;
use Cwd qw(realpath abs_path getcwd);
use File::Basename;

use FindBin;
use lib "${FindBin::Bin}";
use lib "${FindBin::Bin}/impl/bin";
use lib "${FindBin::Bin}/../system/impl/bin";

use SPL::Helper;
use SPL::Msg; # load message constants

#### MAIN
my %opts;
my @options = ('help|h', 'file|f=s');
SPLGetOptionsLong(\&SPL::Msg::SVI_USAGE, \%opts, @options);

my $dist = realpath(dirname($0));
my $xsd = "${dist}/../etc/xsd/SPL/toolkitInfoModel.xsd";
my $xmlLint = "${dist}/../ext/bin/xmllint";

my $file = $opts{file};
SPLDie(1, SPL::Msg::INFO_MODEL_FILE_NOT_SPECIFIED()) unless($file);   

exit 1 unless(system("$xmlLint --noout --schema $xsd $file") >> 8 == 0); 

