Perl Utility: xmlfilter

From Fri Sep 18 10:50:28 1998
Date:    Fri, 18 Sep 1998 11:47:56 -0400 (EDT)
From:    Clark Cooper <>
Subject: xmlfilter
To:      Perl-XML Mailing List <>

I've uploaded a new sample utility, xmlfilter, to:

This utility filters in or out elements from an XML document. The output of the filter should be a well-formed XML document.

Here's the Usage message:

Usage is:
    xmlfilter [-h] [{-+}root] [{-+}el=elname] [{-+}el:elnamepat]
              [{-+}att:attname] [{-+}att:attname:attvalpat] xmlfile

Prints on standard output the result of filtering the given xmlfile
for elements according to the switches. A '-' option will drop the
element from the output; a '+' will keep it. The output should also
be a well-formed XML document.

    -h          Print this message

    [-+]root    Drop (or keep) the root element. Defaults to keep.
                If the root element were named "foo", then -root
                would be equivalent to -el=foo. Note that even if
                you're dropping the root element, it's start and
                end tag are kept in order that the output remains
                a well-formed XML document.

                Drop (or keep) elements of type elname.

                Drop (or keep) element whose type name matches elnamepat.

                Drop (or keep) elements which have an attribute = attname.

                Drop (or keep) elements which have an attribute = attname
                and for which the attribute value matches attvalpat.

Clark Cooper    Logic Technology Inc. 
(518) 385-8380  650 Franklin St., Suite 304
                Schenectady,  NY 12305