#----------------------------------------------------------
# Validate against XML schema.
#----------------------------------------------------------
my $xml_schema =
XML::LibXML::Schema->new(
location => '/Users/dattanik/Programs/XML/admin_server.xsd' );
eval { $xml_schema->validate($dom); };
if ($@) {
print "Looks like schema validation has failed. \n";
print "$@", "\n";
}
else {
print "XML Schema validation succeeded.\n";
}
####
The IP address of the host on which the application is executing.
This regular expression does a rudimentary check on the IP address.
####
Looks like schema validation has failed
Element 'application_host_ip' [ST local, facet 'pattern']: The value '123.123.24.56' is not accepted by the pattern '(\d{1,3}\.){3}\d{1,3}'.
Element 'application_host_ip' [ST local, facet 'pattern']: The value '123.123.24.56' is not accepted by the pattern '(\d{1,3}\.){3}\d{1,3}'.