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

NAME

XML::Ximple - XML in Perl

DESCRIPTION

XiMpLe is a simple XML parser created to provide a tree based XML parser with a more desirable data structure than what was currently availible on CPAN.

SYNOPSIS

  use XML::Ximple (qw( parse_xml_file
                       parse_xml
                       get_root_tag
                       ximple_to_string ));
  $ximple_tree = parse_xml_file ( $filename );
  $ximple_tree = parse_xml ( $string );
  $ximple_tag  = get_root_tag ( $ximple_tree );
  $string      = ximple_to_string ( $ximple_tree );

DATA

  <ximple_tree>     ::=  [ <ximple_tag> ... ]
                     
  <ximple_tag>      ::=  { tag_name => <tag-name>,
                           attrib  => <attribs>
                           content => <ximple_tree>
                           tag_type => <tag-type> }

  <tag-name>        ::= <xml-identifier>

  <attribs>         ::= { <xml-identifier> => String, ... }
                     
  <tag-type>        ::= PI | XMLDecl | DOCTYPE | Comment | undef

FUNCTIONS

parse_xml_file

Given a filename, parse the file as XML and return a Ximple tree.

parse_xml

Given a string, parse it as XML and return a Ximple tree.

get_root_tag

Given a Ximple tree, return the root element as a Ximple leaf.

ximple_to_string

Given a Ximple tree, return XML as a string. This will format the output XML differently than the input.

EXAMPLE

 use XML::Ximple (qw(parse_xml get_root_tag ximple_to_string));
 my $xt = parse_xml(<>);
 print "This looks like a ";
 print get_root_tag($xt)->{tag_name};
 print " type of document.\n";
 print '-'x80;
 print ximple_to_string($xt);

SEE ALSO

XML::Parser
XML::Dumper
XML::Simple
XML::Twig

SUPPORT

Mailing list

<xml-ximple@goreliance.com>

Web site

<http://goreliance.com/devel/xml-ximple>

AUTHOR

 Reliance Technology Consultants, Inc. <http://goreliance.com>
   Mike MacHenry <dskippy@ccs.neu.edu>
   Mike Burns <netgeek@speakeasy.net>