--- loncom/build/xfml_parse.pl 2002/02/20 00:21:42 1.3 +++ loncom/build/xfml_parse.pl 2002/05/22 17:07:50 1.7 @@ -1,7 +1,41 @@ #!/usr/bin/perl +# -------------------------------------------------------- Documentation notice +# Run "perldoc ./lpml_parse.pl" in order to best view the software +# documentation internalized in this program. + +# --------------------------------------------------------- License Information +# The LearningOnline Network with CAPA +# piml_parse.pl - Linux Packaging Markup Language parser +# +# $Id: xfml_parse.pl,v 1.7 2002/05/22 17:07:50 harris41 Exp $ +# +# Written by Scott Harrison, codeharrison@yahoo.com +# +# Copyright Michigan State University Board of Trustees +# +# This file is part of the LearningOnline Network with CAPA (LON-CAPA). +# +# LON-CAPA is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# LON-CAPA is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with LON-CAPA; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# /home/httpd/html/adm/gpl.txt +# +# http://www.lon-capa.org/ +# # YEAR=2002 -# 1/26,1/27,1/28,1/29,1/30,1/31 - Scott Harrison +# 1/26,1/27,1/28,1/29,1/30,1/31,2/20,4/8 - Scott Harrison # ### @@ -27,7 +61,7 @@ use HTML::TokeParser; use strict; unless (@ARGV) { - print <; +open(IN,"<$tofilter"); my @lines=; my $parsestring=join('',@lines); undef @lines; close IN; my $parser = HTML::TokeParser->new(\$parsestring) or die('can\'t create TokeParser object'); @@ -286,3 +320,68 @@ sub format_choice_exclude { [@{$conditions{'cdata'}}]; return ''; } + +# ----------------------------------- POD (plain old documentation, CPAN style) + +=pod + +=head1 NAME + +xfml_parse.pl - This is meant to parse XFML files (XML Filtering Markup Language.) + +=head1 SYNOPSIS + +Usage is for lpml file to come in through standard input. + +=over 4 + +=item * + +1st argument is name of xfml file. + +=back + +Example: + + cat loncapafiles.lpml | perl xfml_parse.pl valid_hosts.xfml + +or + + perl xfml_parse.pl valid_hosts.xfml loncapafiles.lpml + +=head1 DESCRIPTION + +I am using a multiple pass-through approach to parsing +the xfml file. This saves memory and makes sure the server +will never be overloaded. + +=head1 README + +I am using a multiple pass-through approach to parsing +the xfml file. This saves memory and makes sure the server +will never be overloaded. + +=head1 PREREQUISITES + +HTML::TokeParser + +=head1 COREQUISITES + +=head1 OSNAMES + +linux + +=head1 SCRIPT CATEGORIES + +Packaging/Administrative + +=head1 AUTHOR + + Scott Harrison + codeharrison@yahoo.com + +Please let me know how/if you are finding this script useful and +any/all suggestions. -Scott + +=cut +