Commits

shl...@52c325ad-5fd0-0310-8a0f-c43feede02cc  committed 5753439

Add the ::Validate etc.

  • Participants
  • Parent commits 4b8ea92

Comments (0)

Files changed (4)

File XML-GrammarBase/MANIFEST

 Changes
 inc/Test/Run/Builder.pm
 lib/XML/GrammarBase.pm
+lib/XML/GrammarBase/RelaxNG/Validate.pm
 Makefile.PL
 MANIFEST
 META.yml
 README
 t/00-load.t
+t/data/screenplay-xml/xml/with-tags-inside-paragraphs.xml
 t/pod-coverage.t
 t/pod.t

File XML-GrammarBase/lib/XML/GrammarBase.pm

 
     use Moose;
 
+    has '_cfg' => (isa => "XML::Grammar::MyGrammar::Conf", is => "rw");
+
     extends(
-        "XML::Grammar::MyGrammar::Base",
         "XML::GrammarBase::RelaxNG::Validate"
     );
 

File XML-GrammarBase/lib/XML/GrammarBase/RelaxNG/Validate.pm

+package XML::GrammarBase::RelaxNG::Validate;
+
+use strict;
+use warnings;
+
+
+=head1 NAME
+
+XML::GrammarBase::RelaxNG::Validate - base class for a RelaxNG validator
+
+=head1 VERSION
+
+Version 0.0.1
+
+=cut
+
+use Moose;
+
+our $VERSION = '0.0.1';
+
+has '_cfg' => (isa => "XML::GrammarBase::Conf", is => 'rw');
+has '_data_dir' => (isa => 'Str', is => 'rw');
+has '_rng' => (isa => 'XML::LibXML::RelaxNG', is => 'rw');
+has '_xml_parser' => (isa => "XML::LibXML", is => 'rw');
+
+=head1 SYNOPSIS
+
+    package XML::Grammar::MyGrammar::RelaxNG::Validate;
+
+    use Moose;
+
+    extends(
+        "XML::GrammarBase::RelaxNG::Validate"
+    );
+
+    TODO : Fill in.
+
+=head1 FUNCTIONS
+
+=head1 AUTHOR
+
+Shlomi Fish, C<< <shlomif at cpan.org> >>
+
+=head1 BUGS
+
+Please report any bugs or feature requests to C<bug-xml-grammarbase at rt.cpan.org>, or through
+the web interface at L<http://rt.cpan.org/NoAuth/ReportBug.html?Queue=XML-GrammarBase>.  I will be notified, and then you'll
+automatically be notified of progress on your bug as I make changes.
+
+
+
+
+=head1 SUPPORT
+
+You can find documentation for this module with the perldoc command.
+
+    perldoc XML::GrammarBase
+
+You can also look for information at:
+
+=over 4
+
+=item * RT: CPAN's request tracker
+
+L<http://rt.cpan.org/NoAuth/Bugs.html?Dist=XML-GrammarBase>
+
+=item * AnnoCPAN: Annotated CPAN documentation
+
+L<http://annocpan.org/dist/XML-GrammarBase>
+
+=item * CPAN Ratings
+
+L<http://cpanratings.perl.org/d/XML-GrammarBase>
+
+=item * Search CPAN
+
+L<http://search.cpan.org/dist/XML-GrammarBase/>
+
+=back
+
+
+=head1 ACKNOWLEDGEMENTS
+
+
+=head1 COPYRIGHT & LICENSE
+
+Copyright 2009 Shlomi Fish.
+
+This program is distributed under the MIT (X11) License:
+L<http://www.opensource.org/licenses/mit-license.php>
+
+Permission is hereby granted, free of charge, to any person
+obtaining a copy of this software and associated documentation
+files (the "Software"), to deal in the Software without
+restriction, including without limitation the rights to use,
+copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the
+Software is furnished to do so, subject to the following
+conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+OTHER DEALINGS IN THE SOFTWARE.
+
+=cut
+
+1; # End of XML::GrammarBase::RelaxNG::Validate
+

File XML-GrammarBase/t/data/screenplay-xml/xml/with-tags-inside-paragraphs.xml

+<?xml version='1.0' encoding='utf-8'?>
+<!DOCTYPE document SYSTEM "screenplay-xml.dtd">
+<document>
+    <head>
+    </head>
+    <body id="index">
+<scene id="top">
+    <scene id="david_and_goliath">
+        <description>
+            <para>
+                David and 
+                <ulink url="http://en.wikipedia.org/wiki/Goliath">Goliath</ulink> 
+                are standing by each other.
+            </para>
+        </description>
+        <saying character="David">
+            <para>
+                I will kill you.
+            </para>
+        </saying>
+        <saying character="Goliath">
+            <para>
+                no way, you little idiot!
+            </para>
+        </saying>
+        <saying character="David">
+            <para>
+                yes way!
+            </para>
+            <para>
+                In the name of <ulink url="http://real-allah.tld/">Allah, the <bold>merciful</bold>, real merciful</ulink>, I will show you the power 
+                of my sling.
+            </para>
+            <para>
+                I shall sling you and bing you till infinity.
+            </para>
+        </saying>
+        <description>
+            <para>
+                David takes his sling.
+            </para>
+        </description>
+    <saying character="Goliath">
+        <para>
+            I'm still <ulink url="http://wait.tld/">waiting</ulink>.
+        </para>
+    </saying>
+    <saying character="David">
+        <para>
+            so you are.
+        </para>
+    </saying>
+    <description>
+        <para>
+            David puts a stone in his sling and shoots Goliath. He hits.
+        </para>
+    </description>
+</scene>
+</scene>
+</body>
+</document>