I've made a function that parses a string using a XSD-schema
This takes a lot of time because the validator needs to open the XSD-file every time I call the function.
Is there no other way to use a XSD-schema or are there no other arguments for the validator
my code:
sub Parser {
my ($in) = @_;
$validator = XML::Validator::Schema->new (file => 'file.xsd');
$parser = XML::SAX::ParserFactory->parser (Handler => $validator);
eval {
$parser->parse_string ($in)
};
return $@, $in;
}
Thanks,
Wouter
This takes a lot of time because the validator needs to open the XSD-file every time I call the function.
Is there no other way to use a XSD-schema or are there no other arguments for the validator
my code:
sub Parser {
my ($in) = @_;
$validator = XML::Validator::Schema->new (file => 'file.xsd');
$parser = XML::SAX::ParserFactory->parser (Handler => $validator);
eval {
$parser->parse_string ($in)
};
return $@, $in;
}
Thanks,
Wouter