QXP::Validate
Version 1.00
When the strict XML is not used, parsers will not be helpful in validating the document instance. Also, developing a Document type definition for simple markup will not be effective. This module performs the basic functions like validating the inline and stand-alone elements, checking for non-ASCII character in the file, check for dummy characters, check for unintentional key press etc.
use QXP::Validate;
my $foo = QXP::Validate->new(); ...
Will check the presence of the start and end tags for all the inline elements like Italic, Bold etc. All the tags started in the line needs to be closed within the same line. Run this function on a string of text. This will be useful, when you are reading line by line through a file. $stag gives you the number of occurrences for the start tag and $etag gives you the number of occurrences for the end tags.
QXP::Validate->parseinline(``i'');
When you are reading through line by line in a file, this function will store the start and the end tags and increament the counter used for both. Once you have finished reading through the elements, examine the count of $first_parameter. If every opening tag has its respective close tag, the count will be 0. If the value of the variable is >1, it means there are less closing tags than opening tags, on the other hand, if the value is <1 there are less opening tags than closing tags. Call this function using one parameter. The parameter is the tag name which need to be examined.
QXP::Validate->parsetag(``bl'');
Will parse through the file to check whether any non-ASCII characters are present in the file. In a ASCII file, if there are any binary characters found, the function will report a error on the screen and will quit the execution.
QXP::Validate->chk_nonascii();
Will check and report if any character if found repeating more than three times sequentially in a file. When working on a file, if the keyboarder inserts a series of characters unintentionally, they will be reported as errors.
QXP::Validate->chk_seq();
In the text file, if there are any elements starting and closing without any content to it, this function will report a error for that.
QXP::Validate->chk_dummy();
Sriram Rajagopalan, <rjsri at cpan.org>
Please report any bugs or feature requests to
bug-qxp-validate at rt.cpan.org
, or through the web interface at
http://rt.cpan.org/NoAuth/ReportBug.html.
I will be notified, and then you'll automatically be notified of progress on
your bug as I make changes.
You can find documentation for this module with the perldoc command.
perldoc QXP::Validate
You can also look for information at:
Copyright 2008 Sriram Rajagopalan, all rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.