This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
use strict; | |
use warnings; | |
use XML::SAX::ParserFactory; | |
use XML::Validator::Schema; | |
my $validator = XML::Validator::Schema->new(file => 'longtail.xsd'); | |
my $parser = XML::SAX::ParserFactory->parser(Handler => $validator); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0"?> | |
<longtail> | |
<doc> | |
<title>Title 1</title> | |
<abstract>foo bar</abstract> | |
<source_name>majuscule</source_name> | |
<source_url>http://dylansserver.com</source_url> | |
</doc> | |
<doc> | |
<title>Title 2</title> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0"?> | |
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"> | |
<xs:element name="longtail"> | |
<xs:element name="doc"> | |
<xs:sequence> | |
<xs:element name="title" type="xs:string"/> | |
<xs:element name="abstract" type="xs:string"/> | |
<xs:element name="source_name" type="xs:string"/> | |
<xs:element name="source_url" type="xs:string"/> |
NewerOlder