The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

XML::Easy::Classify - classification of XML-related items

SYNOPSIS

        use XML::Easy::Classify qw(
                is_xml_name is_xml_encname is_xml_chardata
                is_xml_attributes
                is_xml_content_object is_xml_content_array
                is_xml_content is_xml_element
        );

        $ok = is_xml_name($foo);
        $ok = is_xml_encname($foo);
        $ok = is_xml_chardata($foo);
        $ok = is_xml_attributes($foo);
        $ok = is_xml_content_object($foo);
        $ok = is_xml_content_array($foo);
        $ok = is_xml_content($foo);
        $ok = is_xml_element($foo);

DESCRIPTION

This module provides various type-testing functions, relating to data types used in the XML::Easy ensemble. These are mainly intended to be used to enforce validity of data being processed by XML-related functions. They do not generate exceptions themselves, but of course type enforcement code can be built using these predicates.

FUNCTIONS

is_xml_name(ARG)

Returns true iff ARG is a plain string satisfying the XML name syntax. (Such names are used to identify element types, attributes, entities, and other things in XML.)

is_xml_encname(ARG)

Returns true iff ARG is a plain string satisfying the XML character encoding name syntax.

is_xml_chardata(ARG)

Returns true iff ARG is a plain string consisting of a sequence of characters that are acceptable to XML. Such a string is valid as data in an XML element (where it may be intermingled with subelements) or as the value of an element attribute.

is_xml_attributes(ARG)

Returns true iff ARG is a reference to a hash that is well-formed as an XML element attribute set. To be well-formed, each key in the hash must be an XML name string, and each value must be an XML character data string.

is_xml_content_object(ARG)

Returns true iff ARG is a reference to an XML::Easy::Content object, and thus represents a chunk of XML content.

is_xml_content_array(ARG)

Returns true iff ARG is a reference to an array of the type that can be passed to XML::Easy::Content's new constructor, and thus lists a chunk of XML content in canonical form.

is_xml_content(ARG)

Returns true iff ARG is a reference to either an XML::Easy::Content object or an array of the type that can be passed to that class's new constructor, and thus represents a chunk of XML content.

is_xml_element(ARG)

Returns true iff ARG is a reference to an XML::Easy::Element object, and thus represents an XML element.

SEE ALSO

Params::Classify, XML::Easy::NodeBasics

AUTHOR

Andrew Main (Zefram) <zefram@fysh.org>

COPYRIGHT

Copyright (C) 2009 Andrew Main (Zefram) <zefram@fysh.org>

LICENSE

This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.