Pitonyak::XMLUtil - Convert Objects to and from XML.
A few simple XML utilities that will convert arbitrary objects to XML and back again. These routines have not been extensively tested.
Change '&' to '&', '<' to '<', '>' to '>', '"' to '``', and ''' to '''``.
The calling parameters are modfied
Change '&' to '&', '<' to '<', '>' to '>', '``' to '"', and '''`` to ''',
The calling parameters are modfied.
This is used to render a string safe to send as XML. Existing entity referenes will have their leading ampersand transformed.
Transform an object into XML. An attempt is made to make this object human readable. Note that if the object is a package object that is referenced as a HASH it is still embedded as a HASH.
Each object in the array is returned as a separate XML string.
An object that is not defined is returned as
A SCALAR is rendered XML safe by converting special characters to entity references. It is otherwise left unchanged.
A Reference to a SCALAR is encoded as
<REF/> for a zero length SCALAR and as
An ARRAY reference is encoded as either
<ARRAY/> or something similar to
A HASH reference is encoded as
A PAIR may be missing a
VALUE which means that it is undefined.
If a value is really the intended value, then it is rendered XML safe by using entity references and no extra space is used. If the value is a reference to something else then the object is converted to XML using extra white space and indentation for easier reading.
Convert XML strings back into objects.
Copyright 2002, Andrew Pitonyak (firstname.lastname@example.org)
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
Version 1.00 Initial release