XML::Easy::Classify - classification of XML-related items
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);
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.
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.)
Returns true iff ARG is a plain string satisfying the XML character encoding name syntax.
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.
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.
Returns true iff ARG is a reference to an XML::Easy::Content object, and thus represents a chunk of XML content.
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.
new
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.
Returns true iff ARG is a reference to an XML::Easy::Element object, and thus represents an XML element.
Params::Classify, XML::Easy::NodeBasics
Andrew Main (Zefram) <zefram@fysh.org>
Copyright (C) 2009 Andrew Main (Zefram) <zefram@fysh.org>
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install XML::Easy, copy and paste the appropriate command in to your terminal.
cpanm
cpanm XML::Easy
CPAN shell
perl -MCPAN -e shell install XML::Easy
For more information on module installation, please visit the detailed CPAN module installation guide.