.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.32
.\"
.\" Standard preamble:
.\" ========================================================================
.de Sh \" Subsection heading
.br
.if t .Sp
.ne 5
.PP
\fB\\$1\fR
.PP
..
.de Sp \" Vertical space (when we can't use .PP)
.if t .sp .5v
.if n .sp
..
.de Vb \" Begin verbatim text
.ft CW
.nf
.ne \\$1
..
.de Ve \" End verbatim text
.ft R
.fi
..
.\" Set up some character translations and predefined strings. \*(-- will
.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
.\" double quote, and \*(R" will give a right double quote. \*(C+ will
.\" give a nicer C++. Capital omega is used to do unbreakable dashes and
.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff,
.\" nothing in troff, for use with C<>.
.tr \(*W-
.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
.ie n \{\
. ds -- \(*W-
. ds PI pi
. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
. ds L" ""
. ds R" ""
. ds C` ""
. ds C' ""
'br\}
.el\{\
. ds -- \|\(em\|
. ds PI \(*p
. ds L" ``
. ds R" ''
'br\}
.\"
.\" If the F register is turned on, we'll generate index entries on stderr for
.\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index
.\" entries marked with X<> in POD. Of course, you'll have to process the
.\" output yourself in some meaningful fashion.
.if \nF \{\
. de IX
. tm Index:\\$1\t\\n%\t"\\$2"
..
. nr % 0
. rr F
.\}
.\"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.hy 0
.if n .na
.\"
.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
.\" Fear. Run. Save yourself. No user-serviceable parts.
. \" fudge factors for nroff and troff
.if n \{\
. ds #H 0
. ds #V .8m
. ds #F .3m
. ds #[ \f1
. ds #] \fP
.\}
.if t \{\
. ds #H ((1u-(\\\\n(.fu%2u))*.13m)
. ds #V .6m
. ds #F 0
. ds #[ \&
. ds #] \&
.\}
. \" simple accents for nroff and troff
.if n \{\
. ds ' \&
. ds ` \&
. ds ^ \&
. ds , \&
. ds ~ ~
. ds /
.\}
.if t \{\
. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
.\}
. \" troff and (daisy-wheel) nroff accents
.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
.ds 8 \h'\*(#H'\(*b\h'-\*(#H'
.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
.ds ae a\h'-(\w'a'u*4/10)'e
.ds Ae A\h'-(\w'A'u*4/10)'E
. \" corrections for vroff
.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
. \" for low resolution devices (crt and lpr)
.if \n(.H>23 .if \n(.V>19 \
\{\
. ds : e
. ds 8 ss
. ds o a
. ds d- d\h'-1'\(ga
. ds D- D\h'-1'\(hy
. ds th \o'bp'
. ds Th \o'LP'
. ds ae ae
. ds Ae AE
.\}
.rm #[ #] #H #V #F C
.\" ========================================================================
.\"
.IX Title "DumpXML 3pm"
.TH DumpXML 3pm "2006-04-08" "perl v5.8.8" "User Contributed Perl Documentation"
.SH "NAME"
Data::DumpXML \- Dump arbitrary data structures as XML
.SH "SYNOPSIS"
.IX Header "SYNOPSIS"
.Vb 2
\& use Data::DumpXML qw(dump_xml);
\& $xml = dump_xml(@list)
.Ve
.SH "DESCRIPTION"
.IX Header "DESCRIPTION"
This module provides a single function called \fIdump_xml()\fR that takes a
list of Perl values as its argument and produces a string as its result.
The string returned is an \s-1XML\s0 document that represents any Perl data
structures passed to the function. Reference loops are handled correctly.
.PP
The following data model is used:
.PP
.Vb 5
\& data : scalar*
\& scalar = undef | str | ref | alias
\& ref : scalar | array | hash | glob | code
\& array: scalar*
\& hash: (key scalar)*
.Ve
.PP
The distribution comes with an \s-1XML\s0 schema and a \s-1DTD\s0 that more formally
describe this structure.
.PP
As an example of the \s-1XML\s0 documents produced, the following call:
.PP
.Vb 2
\& $a = bless [1,2], "Foo";
\& dump_xml($a);
.Ve
.PP
produces:
.PP
.Vb 9
\&
\&
\& [
\&
\& 1
\& 2
\&
\& ]
\&
.Ve
.PP
If \fIdump_xml()\fR is called in a void context, then the dump is printed
on \s-1STDERR\s0 automatically. For compatibility with \f(CW\*(C`Data::Dump\*(C'\fR, there
is also an alias for \fIdump_xml()\fR called simply \fIdump()\fR.
.PP
\&\f(CW\*(C`Data::DumpXML::Parser\*(C'\fR is a class that can restore
data structures dumped by \fIdump_xml()\fR.
.Sh "Configuration variables"
.IX Subsection "Configuration variables"
The generated \s-1XML\s0 is influenced by a set of configuration variables.
If you modify them, then it is a good idea to localize the effect. For example:
.PP
.Vb 5
\& sub my_dump_xml {
\& local $Data::DumpXML::INDENT = "";
\& local $Data::DumpXML::XML_DECL = 0;
\& local $Data::DumpXML::DTD_LOCATION = "";
\& local $Data::DumpXML::NS_PREFIX = "dumpxml";
.Ve
.PP
.Vb 2
\& return dump_xml(@_);
\& }
.Ve
.PP
The variables are:
.IP "$Data::DumpXML::INDENT" 4
.IX Item "$Data::DumpXML::INDENT"
You can set the variable \f(CW$Data::DumpXML::INDENT\fR to control the amount
of indenting. The variable contains the whitespace you want to be
used for each level of indenting. The default is a single space. To
suppress indenting, set it to "".
.IP "$Data::DumpXML::INDENT_STYLE" 4
.IX Item "$Data::DumpXML::INDENT_STYLE"
This variable controls where end element are placed. If you set this
variable to the value \*(L"Lisp\*(R" then end tags are not prefixed by \s-1NL\s0.
This give a more compact output.
.IP "$Data::DumpXML::XML_DECL" 4
.IX Item "$Data::DumpXML::XML_DECL"
This boolean variable controls whether an \s-1XML\s0 declaration should be
prefixed to the output. The \s-1XML\s0 declaration is the
thingy. The default is 1. Set this value to 0 to suppress the
declaration.
.IP "$Data::DumpXML::NAMESPACE" 4
.IX Item "$Data::DumpXML::NAMESPACE"
This variable contains the namespace used for the \s-1XML\s0 elements.
The default is to let this be a \s-1URI\s0 that actually resolve to the \s-1XML\s0
schema on \s-1CPAN\s0. Set it to "" to disable use of namespaces.
.IP "$Data::DumpXML::NS_PREFIX" 4
.IX Item "$Data::DumpXML::NS_PREFIX"
This variable contains the namespace prefix to use on the elements.
The default is "", which means that a default namespace will be declared.
.IP "$Data::DumpXML::SCHEMA_LOCATION" 4
.IX Item "$Data::DumpXML::SCHEMA_LOCATION"
This variable contains the location of the \s-1XML\s0 schema. If this
variable is non\-empty, then an \f(CW\*(C`xsi:schemaLocation\*(C'\fR attribute is
added to the top level \f(CW\*(C`data\*(C'\fR element. The default is not to include
this, as the location can be inferred from the default \s-1XML\s0 namespace
used.
.IP "$Data::DumpXML::DTD_LOCATION" 4
.IX Item "$Data::DumpXML::DTD_LOCATION"
This variable contains the location of the \s-1DTD\s0. If this variable is
non\-empty, then a is included in the output. The
default is to point to the \s-1DTD\s0 on \s-1CPAN\s0. Set it to "" to suppress the
line.
.SH "BUGS"
.IX Header "BUGS"
Class names with 8\-bit characters are dumped as Latin\-1, but
converted to \s-1UTF\-8\s0 when restored by the Data::DumpXML::Parser.
.PP
The content of globs and subroutines are not dumped. They are
restored as the strings \*(L"** glob **\*(R" and \*(L"** code **\*(R".
.PP
\&\s-1LVALUE\s0 and \s-1IO\s0 objects are not dumped at all. They simply
disappear from the restored data structure.
.SH "SEE ALSO"
.IX Header "SEE ALSO"
Data::DumpXML::Parser, XML::Parser, XML::Dumper, Data::Dump
.SH "AUTHORS"
.IX Header "AUTHORS"
The \f(CW\*(C`Data::DumpXML\*(C'\fR module is written by Gisle Aas ,
based on \f(CW\*(C`Data::Dump\*(C'\fR.
.PP
The \f(CW\*(C`Data::Dump\*(C'\fR module was written by Gisle Aas, based on
\&\f(CW\*(C`Data::Dumper\*(C'\fR by Gurusamy Sarathy .
.PP
.Vb 2
\& Copyright 1998\-2003 Gisle Aas.
\& Copyright 1996\-1998 Gurusamy Sarathy.
.Ve
.PP
This library is free software; you can redistribute it and/or
modify it under the same terms as Perl itself.